Firefox execution with selenium grid is not working for me

184 views
Skip to first unread message

mounika....@gmail.com

unread,
Oct 21, 2018, 4:16:39 PM10/21/18
to Selenium Users
Hello,

I am using 3.14 version of selenium standalone server, firefox browser (58 version) and selenium (3.11.0). When I am executing tests remotely through Firefox, multiple Firefox browsers are launching and Url is not pasting on to the address bar. I wonder what is the compatibility of firefox with the selenium and grid. Can anyone please help me to resolve the issue.


Thanks,
Mounika

Sindhu Jvs

unread,
Oct 22, 2018, 1:35:51 AM10/22/18
to seleniu...@googlegroups.com
Hi  Mounika,

   Even I am facing the same problem.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/d1c05d8e-a433-42c5-931d-4c86873bd65f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Krishnan Mahadevan

unread,
Oct 22, 2018, 1:49:42 AM10/22/18
to seleniu...@googlegroups.com

Sindhu/Mounika

 

Neither of you have added enough contextual information to help us figure out what is going wrong.

 

Here’s some information that you can consider adding:

 

  1. What does your code look like?
  2. What happens when you use the same Selenium version across the board [ 3.14 being the latest released version ]
  3. What version of geckodriver are you working with ?
  4. When you run a test, do you see any errors on the Selenium node console?

 

Please feel free to add any more additional information that you think can help figure out the root cause.

 

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/

Sindhu Jvs

unread,
Oct 22, 2018, 2:22:18 AM10/22/18
to seleniu...@googlegroups.com
Krishna,
     
            Please find the details below,

Operating System - Ubuntu
Selenium - 3.14  version

Sample Code - 

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Test1 {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.gecko.driver","/home/tectoro/Desktop/eclipse/Selenium/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
 
Thread.sleep(5000);
driver.quit();
}

}

Please find the Error Below
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: /home/tectoro/Desktop/eclipse/Selenium/geckodriver.exe
at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:132)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:43)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:168)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:168)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at test.sample1.Test1.main(Test1.java:11)


⇜Krishnan Mahadevan⇝

unread,
Oct 22, 2018, 2:26:48 AM10/22/18
to seleniu...@googlegroups.com
Sindhu

You are not using the selenium grid at all. 

The problem lies in this line 

System.setProperty("webdriver.gecko.driver","/home/tectoro/Desktop/eclipse/Selenium/geckodriver.exe")

There is no ".exe" in Linux. Please fix the line and refer to the proper geckodriver executable and try again. 




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

Sindhu Jvs

unread,
Oct 22, 2018, 2:35:21 AM10/22/18
to seleniu...@googlegroups.com
Hi Krishna, 
  
   Can you send me link which files I have to download.

⇜Krishnan Mahadevan⇝

unread,
Oct 22, 2018, 2:37:24 AM10/22/18
to seleniu...@googlegroups.com
Please download from https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz

Once downloaded untar this file into an appropriate directory to get the geckodriver binary and refer it's location in your code. 


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

Sindhu Jvs

unread,
Oct 22, 2018, 2:42:24 AM10/22/18
to seleniu...@googlegroups.com
Krishna,

    Still Iam facing the same problem


⇜Krishnan Mahadevan⇝

unread,
Oct 22, 2018, 2:48:54 AM10/22/18
to seleniu...@googlegroups.com
The root cause remains the same. 
Not sure what additional assistance I can provide beyond what I already have said. 

The general steps would be :

1. Download geckodriver tar file. 
2. Unzip to a location. 
3. Go to the location and run: ./geckodriver 
You should see the binary run. If you get an error you may have to add execution permission to the extracted binary. 
4. Use the location obtained from (3) in your code in the system property. 


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

mounika....@gmail.com

unread,
Oct 22, 2018, 9:45:42 AM10/22/18
to Selenium Users
Hi Krishnan,

  1. What does your code look like?
         if (config.getProperty("browser").equals("Firefox")){
  if (config.getProperty("Target").equals("remote")) {
  try {
  FirefoxOptions options = new FirefoxOptions();
  options.setBinary("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
  capabilities = DesiredCapabilities.firefox();
  capabilities.setCapability("moz:firefoxOptions", options);
  Page.driver = new RemoteWebDriver(new URL(hubURL), capabilities);

      2. What happens when you use the same Selenium version across the board [ 3.14 being the latest released version ]
        I could execute tests on the local machine with firefox but getting error when executing remotely through selenium grid.
  1. What version of geckodriver are you working with ?
        I am using geckodriver-v0.23.0 (latest version)
  1. When you run a test, do you see any errors on the Selenium node console?
          I am getting below exceptions:
     
          Caused by: java.lang.reflect.InvocationTargetException
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)
at cucumber.runtime.java.DefaultJavaObjectFactory.cacheNewInstance(DefaultJavaObjectFactory.java:41)
... 32 more
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Command duration or timeout: 17.40 seconds

Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'



Thanks,
Mounika
Firefox_SeleniumGrid.docx

Atmakur Subrahmanyam

unread,
Oct 22, 2018, 12:09:11 PM10/22/18
to seleniu...@googlegroups.com
Hi All,

Please check the Gecodriver version 


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


--

Thanks&Regards
A.subrahmanyam
9581343402

Vidya Sagar Pogiri

unread,
Oct 22, 2018, 12:21:45 PM10/22/18
to seleniu...@googlegroups.com
Hey instead of downloading the drivers, use driver manager jar

Best,
Vidya,
9966229668.

Sent from my iPhone

Krishnan Mahadevan

unread,
Oct 22, 2018, 10:36:47 PM10/22/18
to seleniu...@googlegroups.com

Mounika,

 

I don’t think you got what I am saying.

 

>>>>>>       2. What happens when you use the same Selenium version across the board [ 3.14 being the latest released version ]

 

I meant what happens when you use Selenium 3.14 at the grid level as well ?

Also have you checked and ensured your geckodriver is all fine in the selenium grid nodes ?

 

You might also want to ensure that the firefox version and geckodriver version is the same on the grid node machines, as what you have in your local desktop (Where firefox test works )

 

 

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/

 

Reply all
Reply to author
Forward
0 new messages