Problem running Selenide in Jenkins

847 views
Skip to first unread message

Anders Persson

unread,
Aug 26, 2016, 2:09:53 PM8/26/16
to selenide
Hi

I have been using Selenide for at least half a year with jenkins. Suddenly about a week ago they start to fail without changing anything in the code or the test. So probably an upgrade of browser or similar. If I run the same tests in Eclipse they run fine.

I have now upgraded to Selenide 2.9 and latest chromdrive but without any improvements.

The message I get is:

Error message

org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.79 seconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'BSharp5', ip: '192.168.1.128', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
selenide.url: https://greena.se
selenide.baseUrl: http://localhost:8080



Stacktrace


org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.79 seconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'BSharp5', ip: '192.168.1.128', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
selenide.url: https://greena.se
selenide.baseUrl: http://localhost:8080
	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:423)

....


Standard Error

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 33102
Only local connections are allowed.
aug 26, 2016 6:34:02 EM com.codeborne.selenide.impl.ScreenShotLaboratory takeScreenShot
VARNING: Cannot take screenshot because browser is not started
aug 26, 2016 6:34:02 EM com.codeborne.selenide.junit.ScreenShooter failed
INFO: 
Screenshot: 
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 10940
Only local connections are allowed.
aug 26, 2016 6:35:04 EM com.codeborne.selenide.impl.ScreenShotLaboratory takeScreenShot
VARNING: Cannot take screenshot because browser is not started
aug 26, 2016 6:35:04 EM com.codeborne.selenide.junit.ScreenShooter failed


....

Any idea about why this happened?


I have seen that others have similar problems but they are using Selenium directly. I have tried to follow those instructions but one thing I have not been able to test is this:

========================================
In my Selenium test, I've changed this method 

    private static WebDriver driver;
    @BeforeClass
    public static void openBrowser() {
        driver = new ChromeDriver();
        driver.get(BASE_URL);
    }

into

    private static WebDriver driver;
    @BeforeClass
    public static void openBrowser() {

        ChromeOptions options = new ChromeOptions();

        options.addArguments("no-sandbox");
        driver = new ChromeDriver(options);
        driver.get(BASE_URL);
    }
========================================

How do I try a similar solution within Selenide?




Regards

Anders

Andrei Solntsev

unread,
Aug 28, 2016, 4:20:46 PM8/28/16
to Anders Persson, selenide
Hi Anders!
Probably the problem is that you use too old version of Selenium WebDriver (that is downloaded automatically with Selenide 2.9, which is also pretty old). 

Don't you want to upgrade to Selenide 3.9.1?
Or at least, upgrade to latest selenium-java 2.53.0


Andrei Solntsev

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anders Persson

unread,
Aug 29, 2016, 3:30:56 PM8/29/16
to selenide, ander...@gmail.com
Hi

It was 3.9 and not 2.9 I had upgraded to. I have now also upgraded to 3.9.1 but I have the same problem.

Regards

Anders

Andrei Solntsev

To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.

Anders Persson

unread,
Aug 31, 2016, 11:38:28 AM8/31/16
to selenide
Hi

Some more information:

I tried to switch to Firefox and then the tests are executed better. But a new problem arise that some of the test cases randomly fails. I have tried with changing the timeout period to 16 seconds from the default 4 seconds but that does not help.  When I earlier used chrome, and before it started to fail, this instability was not present.

At the moment it is ok for me to user either Chrome or Firefox for my testing but long term I want to use both of them.

Regards

Anders

Anders Persson

unread,
Sep 2, 2016, 9:21:32 AM9/2/16
to selenide
Hi

I found out that I could set the chrome device parameters with this:

    @Before
    public void setUp() throws Exception {
        com.codeborne.selenide.Configuration.chromeSwitches = "no-sandbox";

and then my test cases passed again.

Regards

Anders
Reply all
Reply to author
Forward
0 new messages