2015-10-15 82 views
1

当我尝试在IE_11浏览器中执行量角器脚本时,我遇到了以下错误。但是,在Chrome浏览器和Firefox浏览器中正常工作的脚本相同.Saying元素不可见。但当我通过暂停浏览器手动执行脚本时,各个元素都可见。ElementNotVisibleError:无法在量角器IE浏览器中点击元素错误

ElementNotVisibleError: Cannot click on element (WARNING: The server did no t provide any stacktrace information) Command duration or timeout: 141 milliseconds Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16' System info: host: 'XXXXXX', ip: '10.XXX.CCC.33', os.name: 'Windows 7', os.arc h: 'amd64', os.version: '6.1', java.version: '1.8.0_51' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreat eProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZ oomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents =true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLi neSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBro wserUrl= http://localhost:3653/ , takesScreenshot=true, javascriptEnabled=true, ig noreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEna bled=true, unexpectedAlertBehaviour=dismiss}] Session ID: 91db8197-e87b-4564-b1b4-9dd7389e19c6

回答

3

这听起来像你有时间问题。您可以尝试使用预期条件功能(http://www.protractortest.org/#/api?view=ExpectedConditions)。它甚至看起来像他们的例子适合你所需要的:

var EC = protractor.ExpectedConditions; 
var button = $('#xyz'); 
var isClickable = EC.elementToBeClickable(button); 

browser.get(URL); 
browser.wait(isClickable, 5000); //wait for an element to become clickable 
button.click(); 
相关问题