Running selenium test on Linux

109 views
Skip to first unread message

ankit garg

unread,
Jun 9, 2018, 9:06:44 AM6/9/18
to seleniu...@googlegroups.com
Hi,

Can some one please help me on how to run selenium tests on Linux machine?

Regards,
Ankit

Jaydeep kumar pal

unread,
Jun 12, 2018, 2:39:48 AM6/12/18
to Selenium Users
hi ankit,

initially i also faced same issue in Linux environment,but it's very similar to run the selenium in Linux like window.

just to have to take care for defining path of the driver.

in windows we are using double backwards slash but in the Linux we have to use single forward slash also we don't use extension in path


window: systems.setproperties("webdriver.chrome.driver","//D//location.exe");


systems.setproperties("webdriver.chrome.driver",":\D\location");

ankit garg

unread,
Jun 13, 2018, 12:03:14 AM6/13/18
to jaydee...@gmail.com, seleniu...@googlegroups.com
Hey Jaydeep,

Thanks for your response.I am getting below error while running my test on Linux(All these are working fine on Windows)

unknown error: failed to change window state to maximized, current state is normal
        (Session info: chrome=67.0.3396.79)
        (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)


Can you please also let me know if there is any option of running selenium tests in normal mode(I mean not in headless mode)(I am using Jenkins to run my tests and all tests are executing in headless mode by default)'

Regards,
Ankit



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/02db103f-4b4c-45bb-82bd-632d986072ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

total QA

unread,
Jun 13, 2018, 1:58:12 AM6/13/18
to Selenium Users
Hi Ankit,

maximize() method gives an issue depends on the configuration.
Solution for your issue can be resolved by adding the below line.

driver.manage().window().setSize(new Dimension(1700, 1100));

Regards,


On Wednesday, June 13, 2018 at 9:33:14 AM UTC+5:30, ankit garg wrote:
Hey Jaydeep,

Thanks for your response.I am getting below error while running my test on Linux(All these are working fine on Windows)

unknown error: failed to change window state to maximized, current state is normal
        (Session info: chrome=67.0.3396.79)
        (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)


Can you please also let me know if there is any option of running selenium tests in normal mode(I mean not in headless mode)(I am using Jenkins to run my tests and all tests are executing in headless mode by default)'

Regards,
Ankit

---------- Forwarded message ----------
From: Jaydeep kumar pal <jaydee...@gmail.com>
Date: Tue, Jun 12, 2018 at 9:51 AM
Subject: [selenium-users] Running selenium test on Linux
To: Selenium Users <seleniu...@googlegroups.com>


hi ankit,

initially i also faced same issue in Linux environment,but it's very similar to run the selenium in Linux like window.

just to have to take care for defining path of  the driver.

in windows we are using double backwards slash but in the Linux we have to use single forward slash also we don't use extension in path


window: systems.setproperties("webdriver.chrome.driver","//D//location.exe");


systems.setproperties("webdriver.chrome.driver",":\D\location");

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

ankit garg

unread,
Jun 13, 2018, 8:31:59 AM6/13/18
to seleniu...@googlegroups.com, tota...@gmail.com
Thanks for the reponse.

Now I am getting below error message.

Caused by: java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/workspace/TestDemo/src/main/resources/chromedriver_win32/chromedriver.exe


Do i need to do something differently on Linux machine as compared with Windows machine?

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6ce06daa-ec0c-42e6-844e-50081b604211%40googlegroups.com.

Krishnan Mahadevan

unread,
Jun 13, 2018, 8:33:39 AM6/13/18
to seleniu...@googlegroups.com

You cannot run a windows executable on a linux machine. You would need to download the linux variant of chromedriver and if required add execution permissions to it.

 

Easiest way of checking if a binary has executable permissions or not is by invoking it.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

TOTALQA

unread,
Jun 13, 2018, 9:42:03 AM6/13/18
to ankit garg, seleniu...@googlegroups.com
This can be fixed by using the compatible version of executable file in Linux

Jaydeep kumar pal

unread,
Jun 13, 2018, 9:49:23 AM6/13/18
to seleniu...@googlegroups.com
You are using chrome driver for windows environment ...you have to use Chrome driver for Linux environment.


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5_q1tCsXKWI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

ankit garg

unread,
Jun 14, 2018, 1:58:30 AM6/14/18
to seleniu...@googlegroups.com
Thanks all ,I have downloaded the linux version of chrome driver but still getting the error message.I have definde the path as below in my scripts.

src//main//resources//chromedriver_linux64//chromedriver

Can some one please suggest if this is the correct way? and if I need to have the chrome driver at some default location?

Thanks,
ANkit 


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5_q1tCsXKWI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CADpLO8or6AoC06YkcMJ78RJSKjCuC8DYMzNZ0S2tidBqJXfLnA%40mail.gmail.com.

Krishnan Mahadevan

unread,
Jun 14, 2018, 2:00:59 AM6/14/18
to seleniu...@googlegroups.com

Try first running the chromedriver binary manually as below:

 

11:29 $ /usr/local/bin/chromedriver

Starting ChromeDriver 2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85) on port 9515

Only local connections are allowed.

 

If you see an output as above (please replace the path with your actual path), then your chromedriver has the required executable permissions.

If not, you need to add the required executable permissions by using chmod +x command.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5_q1tCsXKWI/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

ankit garg

unread,
Jun 14, 2018, 2:41:53 AM6/14/18
to seleniu...@googlegroups.com, krishnan.ma...@gmail.com
I am able to run chromdriver manually and I can see output like you mentioned above.

But I am getting below error message.

The driver executable does not exist: /usr/local/bin && sudo ./chromedriver
Caused by: java.lang.IllegalStateException: The driver executable does not exist: /usr/local/bin && sudo ./chromedriver


Seems like the path is not correct.I have configured the script to use the path from properties file and I am using something like below.

webdriver.chrome.driver= /usr/local/bin && sudo ./chromedriver

Can you please suggest what can i do?

Regards,
Ankit

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5_q1tCsXKWI/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/F2BFD0EE-5B8E-4491-AEDE-4F88B04DDEF4%40gmail.com.

ankit garg

unread,
Jun 15, 2018, 1:02:42 AM6/15/18
to seleniu...@googlegroups.com, krishnan.ma...@gmail.com
Thanks all ,I am able to run my scripts on Linux now.

Regards,
Ankit

On Thu, Jun 14, 2018 at 12:11 PM, ankit garg <ankit....@gmail.com> wrote:
I am able to run chromdriver manually and I can see output like you mentioned above.

But I am getting below error message.

The driver executable does not exist: /usr/local/bin && sudo ./chromedriver
Caused by: java.lang.IllegalStateException: The driver executable does not exist: /usr/local/bin && sudo ./chromedriver


Seems like the path is not correct.I have configured the script to use the path from properties file and I am using something like below.

webdriver.chrome.driver= /usr/local/bin && sudo ./chromedriver

Can you please suggest what can i do?

Regards,
Ankit


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5_q1tCsXKWI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages