當我試圖找到通過下面的代碼異常在硒的webdriver:b.addEventListener不是函數
driver.findElement(By.cssSelector("input[name=\"passengers[0].passengerName\"]")).sendKeys("xxxxxxxxxxxxxx");
硒拋出以下錯誤輸入元件..
org.openqa.selenium.WebDriverException: b.addEventListener is not a function
Command duration or timeout: 16 milliseconds
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:45'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-13-generic', java.version: '1.6.0_24'
Session ID: e713ccdc-dc05-40a1-923a-8ee51cfa525b
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=16.0.2, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:533)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:302)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:379)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:407)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:294)
at irctcticketbooking.Main.main(Main.java:119)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: b.addEventListener is not a function
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:45'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-13-generic', java.version: '1.6.0_24'
Driver info: driver.version: unknown
at <anonymous class>.<anonymous method>(resource://fxdriver/modules/web_element_cache.js:7185)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/driver_component.js:6821)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/driver_component.js:8245)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/driver_component.js:8260)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/command_processor.js:10222)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/command_processor.js:10227)
at <anonymous class>.<anonymous method>(file:///tmp/anonymous8377906034759035727webdriver-profile/extensions/[email protected]/components/command_processor.js:10167)
I」已經嘗試過元素ID,名稱,CSS和XPath。沒有任何幫助擺脫這種例外。
HTML源文件:https://dl.dropbox.com/u/345966710/A.html 測試Java代碼:https://dl.dropbox.com/u/345966710/Test.java
您將需要共享你企圖用互動..附加文件的 –
@niharika_neo源片的HTML。 – user2039615