Saturday, 6 December 2014

Working with OperaDriver


I have been trying to write WebDriver tests for Opera browser. 

So, I had downloaded the latest versions of Opera , version 26 and selenium-server-standalone jar, 2.44.0.

From what I read from Selenium's official website, I understood that it could be created like the normal FirefoxDriver.

I wrote a simple test,

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import com.opera.core.systems.OperaDriver;

public class OperaDemo {


 public static void main(String[] args)  {


WebDriver driver = new OperaDriver();


driver.manage().window().maximize();


driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 
driver.get("http://www.toolsqa.com/automation-practice-form/");

  driver.quit();

}

}


I was hoping that it would execute right away,as it's such a simple piece of code.. No, it did not :D:D

Exception occured :D

Exception in thread "main" org.openqa.selenium.WebDriverException: org.openqa.selenium.WebDriverException: Runner threw exception on construction Build info: version: '2.44.0' Driver info: driver.version: OperaDriver

Upon checking further, I got to know that,as of now there is support for OperaDriver  only until Opera version 12.X or less from the link


So, I downloaded an older version of Opera , version 12.16 and ran the same test again.

 It wasn't successful still, because of this line of code which is not supported by OperaDriver yet. 

driver.manage().window().maximize();

I removed this line of code, and only then did the application launch.. FINALLY!! 

I hope this helps. If it does , pay it forward...


Lots of energy ..

DR



















No comments:

Post a Comment