Sudeep Sudeep - 1 year ago 140
Java Question

Selenium test fails to start using operadriver

My cross browser test fails only for opera driver since it is working with all the other drivers (chrome, firefox and ie).

Here is the java code.

System.setProperty("webdriver.opera.driver", "...\\operadriver.exe");
driver = new OperaDriver();

Here is the testng class.

<test name="OperaTestCases">
<parameter name="browser" value="opera"/>
<class name="crossBrowser.Test"/>

browser is opening but nothing is happening. and test fails. :)

Answer Source

I suggest you to install Opera 38 and add following code instead your java code.

System.setProperty("", "...\\operadriver.exe");
driver = new ChromeDriver();

I have used new ChromeDriver(). This will start Opera since we are using OperaChromiumDriver. I think this is because the new Opera is based on Chromium and OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver [See].

Hope this helps. :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download