0

Below is the dependencies version i am using :

WebDriverManager-versioned 3.6.1

(Gecko driver versioned 0.24.0)

Firefox versioned 68.0.1 64 bit Windows 10

Selenium version 3.141.59

I have a maven -selenium project with 10+ test classes in testNG.

When i execute these classes on Chrome browsers ,each test class gets executed successfully .

Same test classes when i execute on Firefox using the (WebDriverManager-Gecko driver) the test classes execute for some time say 5-10 seconds and then abruptly closes and opens next test class for execution ,even this test class execute for some time and then closes . Same thing happens with each test class.

I have tried to manually use geckodriver.exe and set up system properties, still it doesnt fix the error

Below is the code i have used for WebDriverManager

if (browser.equals("chrome")) {
                WebDriverManager.chromedriver().setup();
                driver = new ChromeDriver();
            }

            if (browser.equals("firefox")) {
                WebDriverManager.firefoxdriver().setup();
                driver = new FirefoxDriver();
            }

This is the link for the stack trace

  • From stack trace it's error while taking screen shot it seems . Check this https://github.com/mozilla/geckodriver/issues/614 .may be related – Rahul L Jul 27 '19 at 08:16

2 Answers2

0

There must be version discrepancy, just make sure your firefox version is compatible with the gecko driver and then try again.

Zohair
  • 268
  • 2
  • 7
0

Assuing the versions are compatible, Check with the below code while calling the driver.

   System.setProperty("webdriver.gecko.driver", driverPath+"geckodriver.exe");
    driver = new FirefoxDriver();
Sugan
  • 447
  • 1
  • 4
  • 16
  • I've tried this too ! still test cases are getting closed abruptly . Dont know how they are working perfectly well in chrome :( – shikhar Jul 26 '19 at 08:40