ElementNotVisibleError:无法在Protractor IE浏览器

时间:2015-10-15 10:23:02

标签: angularjs node.js automation jasmine protractor

当我尝试在IE_11浏览器中执行我的量角器脚本时,我收到以下错误。但是相同的脚本在chrome和Firefox浏览器中工作正常。显示元素不可见。但是当我通过暂停浏览器手动执行脚本时元素是可见的。

  

ElementNotVisibleError:无法单击元素(警告:服务器没有       t提供任何堆栈跟踪信息)       命令持续时间或超时:141毫秒       构建信息:版本:'2.47.1',修订版:'411b314',时间:'2015-07-30 03:03:16'       系统信息:主机:'XXXXXX',ip:'10 .XXX.CCC.33',os.name:'Windows 7',os.arc       h:'amd64',os.version:'6.1',java.version:'1.8.0_51'       驱动程序信息: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/,takeScreenshot = true,javascriptEnabled = true,ig       noreProtectedModeSettings = false,enableElementCacheCleanup = true,cssSelectorsEna       bled = true,unexpectedAlertBehaviour = dismiss}]       会议ID:91db8197-e87b-4564-b1b4-9dd7389e19c6

1 个答案:

答案 0 :(得分: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();