-2

I am working with Java and selenium webdriver to automate some functions with a loaded web page in Firefox.Not only, I need to restrict javaScript on the web page. To do that I use "noscript_security_suite-5.0.2-fx+sm.xpi" extension on the FireFox browser.

I use geckodriver-v0.15.0-win32, Firefox 53.0.3 (32-bit), org.seleniumhq.selenium version 3.0.1 ,noscript_security_suite-5.0.2-fx+sm.xpi.

I tried with this code.

  • Set gecko.driver System.setProperty("webdriver.gecko.driver","C:\\Users\\Dilanka\\Desktop\\testingNodeRedWithJava\\WorkingNoScript-Booking.com\\geckodriver-v0.15.0-win32\\geckodriver.exe");
  • Load FireFox driver with extension

FirefoxProfile profile = new FirefoxProfile(); profile.addExtension( new File( "C:\\Users\\Dilanka\\Desktop\\testingNodeRedWithJava\\WorkingNoScript-Booking.com\\noscript_security_suite-5.0.2-fx+sm.xpi" ) ); WebDriver driver = new FirefoxDriver(profile);

  • Load the URl driver.get("https://www.google.lk/");

But it didn't work. It was given the error like this.Error in the console

I think this occur mismatch of the versions which I used. Can anyone provide compatible versions?

1 Answers1

0
I found the compatible versions for this issue.

 - selenium dependency   
`<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.3.0</version>
 </dependency>

 - geckodriver-v0.15.0-win32
 - Firefox Setup 52.0.2
 - noscript_security_suite-5.0.2-fx+sm.xpi

Those things overcome the issue.