mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.14k stars 1.52k forks source link

Incorrect JSON status mapping for 'unknown error' (500 expected) error #540

Closed platinumtest closed 7 years ago

platinumtest commented 7 years ago

In order to help us efficiently investigate your issue, please provide the following information:

Firefox Version

FF v52

Platform

Windows 10 Pro x64 Selenium 3.3.0 GeckoDriver v.15

Steps to reproduce -

I'm attempting to do the following after opening altoromutual.com (mock banking site):

  1. Click on the Sign in link
  2. Enter text in the username field
  3. Enter text in the password field
  4. Click log in button

Expected result: User is logged in and sees his account page.

Actual result: After clicking on the sign in link, I received an error in the console window: "HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected)" error. I know the issue happens before entering anything in the username text box because I write to the console window which step I am executing. This issue does not happen in the latest versions of IEServerDriver or ChromeDriver

Test File (Java Source)

package altoromutual;

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities;

public class A001_Login {

public static WebDriver getDriver(String browserName)
{
    if (browserName.equalsIgnoreCase("IE"))
    {
        System.setProperty("webdriver.ie.driver", "C://Selenium_files//drivers//ieDriverServer//IEDriverServer.exe");
        return new InternetExplorerDriver();
    }
    else if (browserName.equalsIgnoreCase("Chrome"))
    {
        System.setProperty("webdriver.chrome.driver", "C://Selenium_files//drivers//chromedriver_win32//chromedriver.exe");
        return new ChromeDriver();
    }
    else // (browserName.equalsIgnoreCase("FF"))
    {

        DesiredCapabilities dc = new DesiredCapabilities();
        dc.setCapability("log", "trace");

        System.setProperty("webdriver.gecko.driver", "C://Selenium_files//drivers//gecko_driver//geckodriver.exe");
        return new FirefoxDriver(dc);
    }

}

public static void main(String[] args) {
    // TODO Auto-generated method stub
    WebDriver driver = getDriver("FF");

    driver.get("http://www.altoromutual.com");

    //1. click on Sign in link
    System.out.println("One");
    driver.findElement(By.cssSelector("a[id='_ctl0__ctl0_LoginLink']")).click();

    //2. enter username
    System.out.println("Two");
    driver.findElement(By.cssSelector("input[id='uid']")).sendKeys("jsmith");
    //3. enter password
    System.out.println("Three");
    driver.findElement(By.cssSelector("input[id='passw']")).sendKeys("Demo1234");
    //4. click login
    System.out.println("Four");
    driver.findElement(By.cssSelector("input[name='btnSubmit']")).click();

}

}

console output from from Selenium:

1489448272004 geckodriver INFO Listening on 127.0.0.1:35256 1489448272698 mozprofile::profile INFO Using profile path C:\Users\Default\AppData\Local\Temp\rust_mozprofile.I1m5R4CmNCuO 1489448272718 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args [] 1489448272730 geckodriver::marionette INFO Connecting to Marionette on localhost:55254 1489448273644 Marionette INFO Listening on port 55254 Mar 13, 2017 7:37:55 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C One Two Mar 13, 2017 7:37:58 PM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected) Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown error has occurred Build info: version: 'unknown', revision: 'b526bd5', time: '2017-03-07 11:11:07 -0800' System info: host: 'IOHC-HP', ip: '169.254.49.75', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{moz:profile=C:\Users\Default\AppData\Local\Temp\rust_mozprofile.I1m5R4CmNCuO, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=10.0, moz:processID=3300, browserName=firefox, platformName=windows_nt}] Session ID: fb41a0bf-1caf-4893-8894-fc04740cefaf *** Element info: {Using=css selector, value=input[id='uid']} 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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:371) at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:468) at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363) at altoromutual.A001_Login.main(A001_Login.java:54)

andreastt commented 7 years ago

This is mapped correctly in the webdriver Rust library: https://github.com/mozilla/webdriver-rust/blob/master/src/error.rs#L95

Can you please include a trace-level log from geckodriver so we can see what is going on?

jgraham commented 7 years ago

I think this might be the issue fixed in Selenium 3.3.1

platinumtest commented 7 years ago

I was going to ask what I needed to do to enable geckodriver logging, but I was able to get around my initial issue by updating selenium.

I updated to Selenium 3.3.1 today as suggested and this fixed the issue of what the unknown error was. When I ran the code with the updated JAR files, selenium would show an error saying that it could not find element "uid", which is the username field. I added a one second time delay between steps one and two and now it works fine under Firefox.

Closing issue.

nex0ma commented 7 years ago

in my case error on: println(" -1") click on partialLinkText("Аналитические панели") println(" 00")

[info] org.openqa.selenium.WebDriverException: An unknown error has occurred [info] Build info: version: '3.3.0', revision: 'b526bd5b41', time: '2017-03-07 19:26:04 +0000' [info] System info: host: 'PC', ip: '*****', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_11' [info] Driver info: org.openqa.selenium.remote.RemoteWebDriver [info] Capabilities [{moz:profile=C:\Users\RE7BC~1.K\AppData\Local\Temp\rust_mozprofile.rfw3Jv3KL3q1, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=6.1, moz:processID=11292, browserName=firefox, platformName=windows_nt}] [info] Session ID: 87e5bbbc-ebc7-4f71-9d8c-e731dbd7b2c7 [info] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [info] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [info] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [info] at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [info] at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) [info] at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) [info] at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) [info] at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) [info] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) [info] at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274) [info] ...

1489570865173 webdriver::server DEBUG Got request POST AbsolutePath("/session/87e5bbbc-ebc7-4f71-9d8c-e731dbd7b2c7/element") 1489570865173 webdriver::command DEBUG Got request body {"value":"Аналитические панели","using":"partial link text"} 1489570865173 geckodriver::marionette DEBUG → 100:[0,44,"findElement",{"using":"partial link text","value":"Аналитические панели"}] 1489570865179 geckodriver::marionette DEBUG ← [1,44,null,{"value":{"element-6066-11e4-a52e-4f735466cecf":"e165809d-07d4-447c-9c8d-b26fd9f059ed","ELEMENT":"e165809d-07d4-447c-9c8d-b26fd9f059ed"}}] 1489570865180 webdriver::server DEBUG Returning status Ok 1489570865180 webdriver::server DEBUG Returning body {"value":{"element-6066-11e4-a52e-4f735466cecf":"e165809d-07d4-447c-9c8d-b26fd9f059ed"}} 1489570865180 hyper::header TRACE Headers.set( "Content-Type", ContentType(Mime(Application, Json, [(Charset, Utf8)])) ) 1489570865180 hyper::header TRACE Headers.set( "Cache-Control", CacheControl([NoCache]) ) 1489570865181 hyper::header TRACE Headers.set( "Content-Length", ContentLength(88) ) 1489570865181 hyper::server::response DEBUG writing head: Http11 Ok 1489570865181 hyper::header TRACE Headers.set( "Date", Date(HttpDate(Tm { tm_sec: 5, tm_min: 41, tm_hour: 9, tm_mday: 15, tm_mon: 2, tm_year: 117, tm_wday: 3, tm_yday: 73, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 181448000 })) ) 1489570865181 hyper::server::response DEBUG headers [ Headers { Connection: close , Content-Type: application/json; charset=utf-8 , Cache-Control: no-cache , Content-Length: 88 , Date: Wed, 15 Mar 2017 09:41:05 GMT , }] 1489570865182 hyper::server::response DEBUG write 88 bytes 1489570865182 hyper::server::response TRACE ending 1489570865182 hyper::server DEBUG keep_alive = false for 127.0.0.1:48963 1489570865183 hyper::server DEBUG keep_alive loop ending for 127.0.0.1:48963 1489570865184 hyper::server DEBUG Incoming stream 1489570865184 hyper::buffer TRACE get_buf [] 1489570865185 hyper::buffer TRACE read_into_buf buf[0..4096] 1489570865185 hyper::buffer TRACE get_buf [u8; 4096][0..356] 1489570865185 hyper::http::h1 TRACE try_parse([80, 79, 83, 84, 32, 47, 115, 101, 115, 115, 105, 111, 110, 47, 56, 55, 101, 53, 98, 98, 98, 99, 45, 101, 98, 99, 55, 45, 52, 102, 55, 49, 45, 57, 100, 56, 99, 45, 101, 55, 51, 49, 100, 98, 100, 55, 98, 50, 99, 55, 47, 101, 108, 101, 109, 101, 110, 116, 47, 101, 49, 54, 53, 56, 48, 57, 100, 45, 48, 55, 100, 52, 45, 52, 52, 55, 99, 45, 57, 99, 56, 100, 45, 98, 50, 54, 102, 100, 57, 102, 48, 53, 57, 101, 100, 47, 99, 108, 105, 99, 107, 32, 72, 84, 84, 80, 47, 49, 46, 49, 13, 10, 67, 111, 110, 116, 101, 110, 116, 45, 84, 121, 112, 101, 58, 32, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 59, 32, 99, 104, 97, 114, 115, 101, 116, 61, 117, 116, 102, 45, 56, 13, 10, 67, 111, 110, 116, 101, 110, 116, 45, 76, 101, 110, 103, 116, 104, 58, 32, 52, 53, 13, 10, 72, 111, 115, 116, 58, 32, 108, 111, 99, 97, 108, 104, 111, 115, 116, 58, 52, 52, 52, 52, 13, 10, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 58, 32, 75, 101, 101, 112, 45, 65, 108, 105, 118, 101, 13, 10, 85, 115, 101, 114, 45, 65, 103, 101, 110, 116, 58, 32, 65, 112, 97, 99, 104, 101, 45, 72, 116, 116, 112, 67, 108, 105, 101, 110, 116, 47, 52, 46, 53, 46, 50, 32, 40, 74, 97, 118, 97, 47, 49, 46, 56, 46, 48, 95, 49, 49, 41, 13, 10, 65, 99, 99, 101, 112, 116, 45, 69, 110, 99, 111, 100, 105, 110, 103, 58, 32, 103, 122, 105, 112, 44, 100, 101, 102, 108, 97, 116, 101, 13, 10, 13, 10, 123, 34, 105, 100, 34, 58, 34, 101, 49, 54, 53, 56, 48, 57, 100, 45, 48, 55, 100, 52, 45, 52, 52, 55, 99, 45, 57, 99, 56, 100, 45, 98, 50, 54, 102, 100, 57, 102, 48, 53, 57, 101, 100, 34, 125]) 1489570865186 hyper::http::h1 TRACE Request.try_parse([Header; 100], [u8; 356]) 1489570865186 hyper::http::h1 TRACE Request.try_parse Complete(311) 1489570865186 hyper::header TRACE raw header: "Content-Type"=[97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 59, 32, 99, 104, 97, 114, 115, 101, 116, 61, 117, 116, 102, 45, 56] 1489570865186 hyper::header TRACE raw header: "Content-Length"=[52, 53] 1489570865186 hyper::header TRACE raw header: "Host"=[108, 111, 99, 97, 108, 104, 111, 115, 116, 58, 52, 52, 52, 52] 1489570865186 hyper::header TRACE raw header: "Connection"=[75, 101, 101, 112, 45, 65, 108, 105, 118, 101] 1489570865186 hyper::header TRACE raw header: "User-Agent"=[65, 112, 97, 99, 104, 101, 45, 72, 116, 116, 112, 67, 108, 105, 101, 110, 116, 47, 52, 46, 53, 46, 50, 32, 40, 74, 97, 118, 97, 47, 49, 46, 56, 46, 48, 95, 49, 49, 41] 1489570865187 hyper::header TRACE raw header: "Accept-Encoding"=[103, 122, 105, 112, 44, 100, 101, 102, 108, 97, 116, 101] 1489570865187 hyper::server::request DEBUG Request Line: Post AbsolutePath("/session/87e5bbbc-ebc7-4f71-9d8c-e731dbd7b2c7/element/e165809d-07d4-447c-9c8d-b26fd9f059ed/click") Http11 1489570865187 hyper::server::request DEBUG Headers { Content-Type: application/json; charset=utf-8 , Content-Length: 45 , Host: localhost:4444 , Connection: Keep-Alive , User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_11) , Accept-Encoding: gzip,deflate , } 1489570865187 hyper::header TRACE Headers.set( "Connection", Connection([Close]) ) 1489570865187 hyper::http::h1 TRACE Sized read, remaining=45 1489570865187 hyper::http::h1 TRACE Sized read: 32 1489570865187 hyper::http::h1 TRACE Sized read, remaining=13 1489570865187 hyper::http::h1 TRACE Sized read: 13 1489570865188 hyper::http::h1 TRACE Sized read, remaining=0 1489570865188 webdriver::server DEBUG Got request POST AbsolutePath("/session/87e5bbbc-ebc7-4f71-9d8c-e731dbd7b2c7/element/e165809d-07d4-447c-9c8d-b26fd9f059ed/click") 1489570865188 webdriver::command DEBUG Got request body {"id":"e165809d-07d4-447c-9c8d-b26fd9f059ed"} 1489570865188 geckodriver::marionette DEBUG → 67:[0,45,"clickElement",{"id":"e165809d-07d4-447c-9c8d-b26fd9f059ed"}] 1489570865196 geckodriver::marionette DEBUG ← [1,45,{"error":"element not visible","message":"","stacktrace":"WebDriverError@chrome://marionette/content/error.js:160:5\nElementNotVisibleError@chrome://marionette/content/error.js:208:5\ninteraction.clickElement@chrome://marionette/content/interaction.js:133:11\nTaskImpl_run@resource://gre/modules/Task.jsm:319:42\nTaskImpl@resource://gre/modules/Task.jsm:277:3\ncreateAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:252:14\nTask_spawn@resource://gre/modules/Task.jsm:166:12\nTaskImpl_handleResultValue@resource://gre/modules/Task.jsm:389:16\nTaskImpl_run@resource://gre/modules/Task.jsm:327:15\nTaskImpl@resource://gre/modules/Task.jsm:277:3\ncreateAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:252:14\nTask_spawn@resource://gre/modules/Task.jsm:166:12\ndispatch/<@chrome://marionette/content/listener.js:186:15\n"},null] 1489570865198 webdriver::server DEBUG Returning status BadRequest 1489570865198 webdriver::server DEBUG Returning body {"value":{"error":"element not visible","message":"","stacktrace":"stack backtrace:\n 0: 0x61f07f - \n 1: 0x61fe59 - \n 2: 0x43b0b5 - \n 3: 0x420313 - \n 4: 0x408307 - \n 5: 0x6750f9 - \n 6: 0x416877 - \n 7: 0x66ed53 - \n 8: 0x772b652d - BaseThreadInitThunk"}} 1489570865198 hyper::header TRACE Headers.set( "Content-Type", ContentType(Mime(Application, Json, [(Charset, Utf8)])) ) 1489570865198 hyper::header TRACE Headers.set( "Cache-Control", CacheControl([NoCache]) ) 1489570865199 hyper::header TRACE Headers.set( "Content-Length", ContentLength(438) ) 1489570865199 hyper::server::response DEBUG writing head: Http11 BadRequest 1489570865199 hyper::header TRACE Headers.set( "Date", Date(HttpDate(Tm { tm_sec: 5, tm_min: 41, tm_hour: 9, tm_mday: 15, tm_mon: 2, tm_year: 117, tm_wday: 3, tm_yday: 73, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 199448000 })) ) 1489570865199 hyper::server::response DEBUG headers [ Headers { Connection: close , Content-Type: application/json; charset=utf-8 , Cache-Control: no-cache , Content-Length: 438 , Date: Wed, 15 Mar 2017 09:41:05 GMT , }] 1489570865199 hyper::server::response DEBUG write 438 bytes 1489570865199 hyper::server::response TRACE ending 1489570865199 hyper::server DEBUG keep_alive = false for 127.0.0.1:48964 1489570865200 hyper::server DEBUG keep_alive loop ending for 127.0.0.1:48964

platinumtest commented 7 years ago

@nex0ma I noticed that you are using 3.3.0. Did you try updating to Selenium 3.3.1 and see if that worked for you?

nex0ma commented 7 years ago

wow, 3.3.1 worked. i sew that FF started with both modes (Firefox and Remote) on win7. Thanks, many thanks! other webdrivers (chrome, phantomjs, iexplorer) also work with 3.3.1. i need to get approve for linux-webdrivers.

nex0ma commented 7 years ago

but if i have error in previous session, other remote connections impossibled

[info] org.openqa.selenium.SessionNotCreatedException: Session is already started (WARNING: The server did not provide any stacktrace information) [info] Command duration or timeout: 0 milliseconds [info] Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000' [info] System info: host: 'KHAMIDULLIN-PC', ip: '172.16.4.125', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_11' [info] Driver info: driver.version: RemoteWebDriver [info] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [info] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [info] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [info] at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [info] at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) [info] at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) [info] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:367) [info] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:113) [info] at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141) [info] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)

tmbenhura commented 7 years ago

Received the same error org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected):

            driver.findElement(By.id("password")).sendKeys(password);
            driver.findElement(By.cssSelector("li > form > btn-primary")).click();
            System.out.print("Logging In");

The password is entered, but the button is never clicked.

FF52 Selenium Java 3.3.0 Geckodriver 0.15

The test was working properly in Eclipse Luna, the error started when I moved to IntellJ Community Edition.

FYI - Changing to Selenium 3.3.1 gives

org.openqa.selenium.SessionNotCreatedException: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800'
System info: host: 'MY-PC', ip: '196.19.4.10', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_40'
Driver info: driver.version: FirefoxDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    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.ProtocolHandshake.createSession(ProtocolHandshake.java:367)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:113)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:150)
    at MyApp.test(MyApp.java:57)

The ip, os.name, os.arch reported by the sytem info are also incorrect. I use Windows 10 with and Intel i7 64 bit processor.

I had already specified the binary via System.setProperty("webdriver.firefox.bin", );

Deepikakm commented 7 years ago

I am getting this error. Here the script. System Config : Windows 10 (x64),Selenium 3.3.1,Firefox 53

public class LoginPage { WebDriver driver; @BeforeTest public void setUp() { System.setProperty("webdriver.gecko.driver", "C:\Users\v-demuta\Downloads\New folder\geckodriver-v0.15.0-win64\geckodriver.exe"); driver=new FirefoxDriver(); driver.navigate().to("http://hmsdemov5.wtipl.in/"); driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS); }

@Test public void adminLogin() throws InterruptedException { driver.findElement(By.id("Name")).sendKeys("admin"); driver.findElement(By.id("Password")).sendKeys("123"); driver.findElement(By.id("log")).click();

   driver.findElement(By.linkText("Expense")).click();
   Thread.sleep(1000);
   //driver.findElement(By.xpath("//a[span[contains[text()='Expense']]]")).click();
   driver.findElement(By.xpath("//a[@href='#/Expense/ExpenseList']")).click();

   //driver.findElement(By.linkText("Add Expense List")).click();

} }

[TestNG] Running: C:\Users\v-demuta\AppData\Local\Temp\testng-eclipse-1130800200\testng-customsuite.xml

1489745899778 geckodriver INFO Listening on 127.0.0.1:17560 1489745900438 mozprofile::profile INFO Using profile path C:\Users\v-demuta\AppData\Local\Temp\rust_mozprofile.KPTR4q0MuG1k 1489745900444 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args [] 1489745900453 geckodriver::marionette INFO Connecting to Marionette on localhost:21629 1489745901527 Marionette INFO Listening on port 21629 Mar 17, 2017 3:48:24 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C JavaScript error: http://hmsdemov5.wtipl.in/, line 75: ReferenceError: $ is not defined JavaScript error: http://hmsdemov5.wtipl.in/, line 82: ReferenceError: $ is not defined JavaScript error: http://hmsdemov5.wtipl.in/Areas/Hospital/Content/DischargeSummary/CtrDischrge2.js, line 433: SyntaxError: missing ) after argument list JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Billing/Content/InPatient/SvcInPatient.js, line 352: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Billing/Content/InPatient/SvcInPatient.js, line 375: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Doctors/Content/DoctorPayment/SvcDoctorPayment.js, line 365: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Doctors/Content/DoctorPayment/SvcDoctorPayment.js, line 387: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Laboratory/Content/LabInpatient/SvcLabInPatient.js, line 502: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Laboratory/Content/LabInpatient/SvcLabInPatient.js, line 525: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Pharmacy/Content/PharmacyInPatient/SvcPhaInPatient.js, line 459: unreachable code after return statement JavaScript warning: http://hmsdemov5.wtipl.in/Areas/Pharmacy/Content/PharmacyInPatient/SvcPhaInPatient.js, line 482: unreachable code after return statement Mar 17, 2017 3:49:32 PM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected) FAILED: adminLogin org.openqa.selenium.WebDriverException: An unknown error has occurred Build info: version: '3.3.0', revision: 'b526bd5', time: '2017-03-07 11:21:31 -0800' System info: host: 'DEEPIKAKM', ip: '10.171.94.78', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{moz:profile=C:\Users\v-demuta\AppData\Local\Temp\rust_mozprofile.KPTR4q0MuG1k, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=10.0, moz:processID=27948, browserName=firefox, platformName=windows_nt}] Session ID: 7445c343-2d0f-434b-9cdb-5aba9b55c44f *** Element info: {Using=xpath, value=//a[@href='#/Expense/ExpenseList']} 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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:371) at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:476) at org.openqa.selenium.By$ByXPath.findElement(By.java:361) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363) at samplepkg.LoginPage.adminLogin(LoginPage.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) at org.testng.internal.Invoker.invokeMethod(Invoker.java:643) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:782) at org.testng.TestRunner.run(TestRunner.java:632) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244) at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) at org.testng.TestNG.run(TestNG.java:1064) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

Not every time I am getting this error.If i tried to execute script for multiple times then I am getting error.Please give me any suggestion for this weird behaviour

Deepikakm commented 7 years ago

Getting error message used selenium 3.4.0

public class test { public class UpdateResume {

    WebDriver driver;
    @BeforeTest
    public void setUp()
    {
        System.setProperty("webdriver.gecko.driver", "C:\\Users\\v-demuta\\Downloads\\New folder\\geckodriver-v0.15.0-win64\\geckodriver.exe");
        driver=new FirefoxDriver();
        driver.navigate().to("https://login.naukri.com/nLogin/Login.php");
        driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
    }

    @Test
    public void updateResume()
    {
        driver.findElement(By.id("emailTxt")).sendKeys("mutalik.k.deepa@gmail.com");
        driver.findElement(By.id("pwd1")).sendKeys("keshav09");
        driver.findElement(By.id("sbtLog")).click();
        driver.findElement(By.className("feedbackBtn fl")).click();
        driver.findElement(By.className("w205")).click();
        driver.findElement(By.id("uploadLink")).click();
        driver.findElement(By.id("attachCV")).sendKeys("Downloads\\Deepika_Testing_Profile.docx");
        driver.findElement(By.className("w85bt fl")).click();

    }

[TestNG] Running: C:\Users\v-demuta\AppData\Local\Temp\testng-eclipse-1910069654\testng-customsuite.xml

1493806757928   geckodriver INFO    Listening on 127.0.0.1:47072
1493806758744   mozprofile::profile INFO    Using profile path C:\Users\v-demuta\AppData\Local\Temp\rust_mozprofile.0R6H06xGpgFD
1493806758750   geckodriver::marionette INFO    Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args []
1493806758757   geckodriver::marionette INFO    Connecting to Marionette on localhost:25911
1493806761681   Marionette  WARN    Deprecated preference marionette.defaultPrefs.enabled detected, please use marionette.enabled
1493806764785   Marionette  INFO    Listening on port 25911
May 03, 2017 3:49:25 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
FAILED: updateResume
org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DEEPIKAKM', ip: '10.171.76.172', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\v-demuta\AppData\Local\Temp\rust_mozprofile.0R6H06xGpgFD, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=54.0, platformVersion=10.0, moz:processID=13976.0, browserName=firefox, javascriptEnabled=true, platformName=windows_nt}]
Session ID: 0a240f4d-c49a-42fb-bf82-be0053df9f84
    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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:272)
    at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:96)
    at testsample.test$UpdateResume.updateResume(test.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:782)
    at org.testng.TestRunner.run(TestRunner.java:632)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
    at org.testng.SuiteRunner.run(SuiteRunner.java:268)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
    at org.testng.TestNG.run(TestNG.java:1064)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 13 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@19dfb72a: 14 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@34ce8af7: 56 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@1e643faf: 36 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@71be98f5: 16 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@2d6e8792: 11 ms
andreastt commented 7 years ago

@Deepikakm What makes you think this is the same issue?

This line from your stacktrace certainly seems to indicate it is not:

org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string
Deepikakm commented 7 years ago

@andreastt The one which i have mentioned on march 27 has this problem. INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected) FAILED: adminLogin.

The one which i have mentioned above i was getting element not interactable exception in FF but in chrome it worked for me.

andreastt commented 7 years ago

@Deepikakm But the error you get is fundamentally different from the issue reported in this issue?

I suggest you file a new issue about your problem.

mariamToujeni commented 5 years ago

Hello everyone, I have the same "1542103041912 Marionette TRACE 0 -> [0,1,"newSession",{"acceptInsecureCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptInsecureCerts":true,"browserName":"firefox"}}}] 1542103041913 Marionette TRACE 0 <- [1,1,{"error":"unknown command","message":"newSession","stacktrace":"WebDriverError@chrome://marionette/content/error.js:178: ... et@chrome://marionette/content/server.js:245:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9\n"},null] nov. 13, 2018 10:57:21 AM org.openqa.selenium.remote.ErrorCodes toStatus INFOS: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected) " error

I am on Linux with versions: Selenium :3.11.0 Geckodriver:0.23.0 Marionette : 18.1 Firefox :63.0

`System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");

        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", false);

        ProfilesIni profile = new ProfilesIni();
        FirefoxProfile profiles = profile.getProfile(profil);
        FirefoxOptions options = new FirefoxOptions();
        options.setProfile(profiles);
        options.addArguments("--disable-notifications");
        options.addArguments("--marionette-port 2828");
        options.addPreference("log", "{level: trace}");

        driver = (FirefoxDriver)webdriverClass.getConstructor(FirefoxOptions.class).newInstance(options);

`

What should i do?