IE10和IE11中的ElementNotVisibleException

时间:2015-04-23 15:56:55

标签: c# selenium-webdriver internet-explorer-10 internet-explorer-11

我有一个为Chrome驱动程序工作的测试用例。

然后我为ie10和ie-11驱动程序(使用BrowserStack)执行它,并且它抛出一个exeception(见下文)基本上我使用

选择一个元素

IWebElement myElement = _driver.FindElement(By.XPath("//*/input[@type='file']"));

方法。我跑的时候

myElement.SendKeys(@"C:\Users\hello\Documents\images\wallpaper1.jpg");

它抛出了下面的例外。

    OpenQA.Selenium.ElementNotVisibleException : Element is not displayed
 (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 61 milliseconds
    Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
    System info: host: '5-255-92-204', ip: '5.255.92.204', os.name: 'windows', os.arch: 'x86', os.version: '6.2', java.version: '1.8.0_40'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=10, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=true, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:31891/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
    Session ID: 3380bb44-31a8-45a6-90c1-84447a153e7a

但元素在页面内。

0 个答案:

没有答案