I'm creating a program to go into my router and adjust settings, and to do it from different browsers, I've got FF, Chrome, and IE to work. Everything I try with Opera won't work. It only opens up two tabs, one with 127.0.0.1:some_crazy_port# and file:///C:/Users/EETEST~1/AppData/Local/Temp/opera4672404649060883314profile/ When I'm trying to get to, 192.168.0.1
System: Windows 7: Eclipse Kepler & Selenium 2.37.0
Here's my code:
import com.opera.core.systems.OperaDriver;
import com.thoughtworks.selenium.*;
import org.junit.Test;
import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.Select;
public class NewTest extends SeleneseTestCase {
private WebDriver cDriver;
private String baseUrl;
public void setUp() throws Exception{
baseUrl = "192.168.0.1";//Heres the destination
System.setProperty("webdriver.opera.driver", "C:\\Program Files (x86)\\Opera");
cDriver = new OperaDriver();//Setting up the OperaDriver
}
@Test
public void test() throws Exception{
try{
cDriver.navigate().to(baseUrl);//Go!
//Thread.sleep(5000);//Everything below is just doing stuff on the page
cDriver.findElement(By.id("radioButtonssBasic")).click();
Select selector = new Select(cDriver.findElement(By.id("ap")));
selector.selectByValue("0SSIDisNAMED"+router);
cDriver.findElement(By.name("passphrase1")).sendKeys(routerPass);
cDriver.findElement(By.name("passphrase2")).sendKeys(routerPass);
cDriver.findElement(By.id("user")).sendKeys(user);
cDriver.findElement(By.name("password1")).sendKeys(userPass);
cDriver.findElement(By.name("password2")).sendKeys(userPass);
cDriver.findElement(By.id("submitButton")).click();
}finally{
Thread.sleep(2000);
cDriver.quit();
}
For Opera versions below 12, use OperaPrestoDriver
https://github.com/operasoftware/operaprestodriver
For Opera versions above 12, use operachromiumdriver
https://github.com/operasoftware/operachromiumdriver/releases
Which version of Opera are you using? As far as I understand the OperaDriver won't support any Opera versions > 12.x.
Current implementation of OperaDriver supports only 12.x and older versions of Opera browser (based on Presto engine) and does not support newer versions (based on Blink engine).
Since Opera dropped the WebKit engine and started using Google's Blink engine, I assume there has to be another driver to support Opera.
I'm currently searching for a solution myself, so I don't really know if there is one yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With