eclipse - How to solve org.openqa.selenium.NoSuchElementException: no such element -
i trying login facebook using excel sheet .in program excelsheet imports username , password shows error while login functionality calls , shows no such element error my excel sheet is
fileinputstream fi=new fileinputstream("e:\\workspace99\\seleniumautomations\\or\\login_or.xls"); workbook w=workbook.getworkbook(fi); sheet s=w.getsheet("login"); driver.findelement(by.id(s.getcell(0,1).getcontents())).sendkeys("rishy9999@gmail.com"); driver.findelement(by.id(s.getcell(1,1).getcontents())).sendkeys("chandu"); thread.sleep(1000); driver.findelement(by.id(s.getcell(2,1).getcontents())).click(); thread.sleep(5000); throws: org.openqa.selenium.nosuchelementexception: no such element (session info: chrome=34.0.1847.116) (driver info: chromedriver=2.6.232923,platform=windows nt 6.1 x86) (warning: server did not provide stacktrace information) command duration or timeout: 61 milliseconds documentation on error, please visit: http://seleniumhq.org/exceptions/no_such_element.html build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38' system info: os.name: 'windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_01' session id: 8258b613a2b39bccb3f9fa30624d3acd driver info: org.openqa.selenium.chrome.chromedriver capabilities [{platform=xp, acceptsslcerts=true, javascriptenabled=true, browsername=chrome, chrome={userdatadir=c:\users\user\appdata\local\temp\scoped_dir3768_17298}, rotatable=false, locationcontextenabled=true, version=34.0.1847.116, takesheapsnapshot=true, cssselectorsenabled=true, databaseenabled=false, handlesalerts=true, browserconnectionenabled=false, webstorageenabled=true, nativeevents=true, applicationcacheenabled=false, takesscreenshot=true}] @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:525) @ org.openqa.selenium.remote.errorhandler.createthrowable(errorhandler.java:191) @ org.openqa.selenium.remote.errorhandler.throwifresponsefailed(errorhandler.java:145) @ org.openqa.selenium.remote.remotewebdriver.execute(remotewebdriver.java:554) @ org.openqa.selenium.remote.remotewebdriver.findelement(remotewebdriver.java:307) @ org.openqa.selenium.remote.remotewebdriver.findelementbyid(remotewebdriver.java:348) @ org.openqa.selenium.by$byid.findelement(by.java:216) @ org.openqa.selenium.remote.remotewebdriver.findelement(remotewebdriver.java:299) @ iostream.login2.f(login2.java:25) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ org.testng.internal.methodinvocationhelper.invokemethod(methodinvocationhelper.java:84) @ org.testng.internal.invoker.invokemethod(invoker.java:714) @ org.testng.internal.invoker.invoketestmethod(invoker.java:901) @ org.testng.internal.invoker.invoketestmethods(invoker.java:1231) @ org.testng.internal.testmethodworker.invoketestmethods(testmethodworker.java:127) @ org.testng.internal.testmethodworker.run(testmethodworker.java:111) @ org.testng.testrunner.privaterun(testrunner.java:767) @ org.testng.testrunner.run(testrunner.java:617) @ org.testng.suiterunner.runtest(suiterunner.java:334) @ org.testng.suiterunner.runsequentially(suiterunner.java:329) @ org.testng.suiterunner.privaterun(suiterunner.java:291) @ org.testng.suiterunner.run(suiterunner.java:240) @ org.testng.suiterunnerworker.runsuite(suiterunnerworker.java:52) @ org.testng.suiterunnerworker.run(suiterunnerworker.java:86) @ org.testng.testng.runsuitessequentially(testng.java:1224) @ org.testng.testng.runsuiteslocally(testng.java:1149) @ org.testng.testng.run(testng.java:1057) @ org.testng.remote.remotetestng.run(remotetestng.java:111) @ org.testng.remote.remotetestng.initandrun(remotetestng.java:204) @ org.testng.remote.remotetestng.main(remotetestng.java:175)
please check facebook language selected 'english(us)' , browser default locale on trying run on en_us. have seen changes in "id" different locale. e.g., have checked in browser locale french , launched facebook. id of 'login' button 'u_0_l'. english(us) 'u_0_n'. hope might 1 of reason exception.
Comments
Post a Comment