Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonException while opening an url on remote web driver #2396

Closed
srilakshmishankar opened this issue Feb 23, 2021 · 10 comments
Closed

JsonException while opening an url on remote web driver #2396

srilakshmishankar opened this issue Feb 23, 2021 · 10 comments

Comments

@srilakshmishankar
Copy link

srilakshmishankar commented Feb 23, 2021

I get below error randomly while trying to open a page on remote webdriver. This was rare before and since a couple of days it has become very frequent and I am out of ideas to fix this. Not all tests that have page.open() fail, only few especially when I try to open new tab and open a page and sometimes just page.open() as well. Any suggestion or tweaks will be really helpful. Tests were stable and now suddenly this is making unstable. In the report screenshot shows that I am on correct page after open but this error appears.

The tests run on grid. Locally I cannot reproduce this issue.

org.openqa.selenium.json.JsonException: Unable to determine type from: <. Last 1 characters read: < Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'runner-dfgiwod7-project-230-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1029-aws', java.version: '11.0.10' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:122) at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:140) at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126) at org.openqa.selenium.json.Json.toType(Json.java:69) at org.openqa.selenium.json.Json.toType(Json.java:55) at org.openqa.selenium.json.Json.toType(Json.java:50) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:87) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:277) at net.thucydides.core.webdriver.WebDriverFacade.get(WebDriverFacade.java:172) at net.serenitybdd.core.pages.PageObject.openPageAtUrl(PageObject.java:914) at net.serenitybdd.core.pages.PageObject.open(PageObject.java:815) at net.serenitybdd.core.pages.PageObject.open(PageObject.java:803)

@wakaleo
Copy link
Member

wakaleo commented Feb 23, 2021

That looks like some kind of driver issue.

@srilakshmishankar
Copy link
Author

That looks like some kind of driver issue.

I see this in logs related to this error
Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.remote.RemoteWebDriver (The appium.platformName needs to be specified (either IOS or ANDROID)). See below for more details. at net.thucydides.core.webdriver.WebDriverFactory.newWebdriverInstance(WebDriverFactory.java:159) at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:141) at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:132) at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:102) at net.thucydides.core.pages.Pages.isHtmlUnitDriver(Pages.java:152) at net.thucydides.core.pages.Pages.openHtmlUnitDriverIfNotOpen(Pages.java:137) at net.thucydides.core.pages.Pages.openBrowserIfRequiredFor(Pages.java:130) at net.thucydides.core.pages.Pages.currentPageAt(Pages.java:118)

Not sure what but I am automating an web application and I don't use Appium here.
I am still facing this exception and has become more frequent recently. What else info can I provide on this?

@wakaleo
Copy link
Member

wakaleo commented Jun 15, 2021

What version are you using?

@srilakshmishankar
Copy link
Author

Today I updated to 2.4.34

@srilakshmishankar
Copy link
Author

srilakshmishankar commented Jun 16, 2021

Hi @wakaleo , do you know any info or can I provide any more details?

@wakaleo
Copy link
Member

wakaleo commented Jun 16, 2021

If it happens randomly and not on a local run that would point to a problem of stability on the remote service side.

@srilakshmishankar
Copy link
Author

So all issues are happening when running on remote webdriver:

  1. org.openqa.selenium.json.JsonException: Unable to determine type from: <. Last 1 characters read: < --> the most frequent issue and happens only with Page.open()

Below issues after recently I updated serenity versions
2. Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.remote.RemoteWebDriver (The appium.platformName needs to be specified (either IOS or ANDROID)).
3. WARN n.s.core.photography.PhotoSession - Failed to take screenshot com.assertthat.selenium_shutterbug.utils.web.UnableTakeSnapshotException: javax.imageio.IIOException: Error reading PNG image data

@wakaleo
Copy link
Member

wakaleo commented Jun 16, 2021

Possibly load issues with your selenium grid or remote server? I don't think it's related to your code.

@srilakshmishankar
Copy link
Author

Hi @wakaleo,

So whenever I skip a test using a tag I get below error and it makes gradle test task fail even though the pipeline has passed. The test gets skipped but on gradle it says test failed. On serenity test report it is skipped, no problem there.

Screenshot 2021-06-23 at 12 07 03

Any info on this?
How should I skip the test? I am not even running test on Firefox and and there is Firefox driver exception.

@srilakshmishankar
Copy link
Author

Okay above happens when I have tags @Skip and @Skipprod.
@Skip I was using by default skip on environment and @Skipprod for just skipping on prod environment. In my gradle test command for prod I was passing 'not @Skipprod' and it was causing above exception in the screenshot. Now I changed it to 'not @Skip and not @Skipprod' so it works fine.

I think some how it was getting messed.

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants