Selenium WebDriver can find element in Chrome but not in FireFox and IE-11

I wrote the following  code  to find elementin Java when on run on chrome , it identifies the control but when run from firefox and IE-11 , it did not find control.

I also try with name and xpath but result was same not found control.

Can somebody help me . what should i do ?

WebElement BtnSubmit = driver.findElement(By.id(“btnSubmit”));
BtnSubmit.click();

Default Asked on February 16, 2017 in Selenium WebDriver.

any Exception?

on February 16, 2017.

Below is the complete error:

Listening on port 3639
Only local connections are allowed
Feb 23, 2017 2:10:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread “main” org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 54 milliseconds
Build info: version: ‘unknown’, revision: ’86a5d70′, time: ‘2017-02-16 07:47:51 -0800’
System info: host: ‘FARRUKH-PC’, ip: ‘192.168.0.112’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_121′
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:3639/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 0d886e55-d7a8-4753-92a7-36fdfff6e7c1
*** Element info: {Using=xpath, value=.//*[@id=’loginForm’]/div/div/div[3]/input}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at CRM.Testcase.main(Testcase.java:29)

on February 23, 2017.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.