5

I have tried to open a URL using the OperaDriver. My issue is that I am getting browser launched but the desired page is not getting loaded. Below is the code.

@BeforeClass
public static void setUpBeforeClass() throws Exception {


/*  DesiredCapabilities capabilities = DesiredCapabilities.opera();
      capabilities.setCapability("opera.binary","C:/Program Files(x86)/Opera/opera.exe");
      driver = new OperaDriver(capabilities); 
      */

      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability("opera.binary","Opera/opera.exe");
      //capabilities.setCapability("opera.log.level", "CONFIG");
      capabilities.setCapability("opera.port", "-1");
      capabilities.setCapability("opera.profile", "");
       driver = new OperaDriver(capabilities);



}

@Test
public void testCreateAccount() throws Exception{

driver.navigate().to("http://google.com/");



}

I am using Opera browser version 11.10 and running test as JUnit.

When it fails, the following is returned in the console.

Exception in thread "stp-thread" java.nio.channels.ClosedSelectorException at sun.nio.ch.SelectorImpl.selectedKeys(SelectorImpl.java:75) at com.opera.core.systems.util.SocketMonitor.pollSockets(SocketMonitor.java:132) at com.opera.core.systems.util.SocketMonitor.poll(SocketMonitor.java:108) at com.opera.core.systems.scope.stp.StpThread.run(StpThread.java:60)

Thanks in advance

3
  • If you let it fail, what's the error that's returned? – Lyndon Vrooman Oct 15 '12 at 19:38
  • Lyndon i am getting following error in console, Exception in thread "stp-thread" java.nio.channels.ClosedSelectorException at sun.nio.ch.SelectorImpl.selectedKeys(SelectorImpl.java:75) at com.opera.core.systems.util.SocketMonitor.pollSockets(SocketMonitor.java:132) at com.opera.core.systems.util.SocketMonitor.poll(SocketMonitor.java:108) at com.opera.core.systems.scope.stp.StpThread.run(StpThread.java:60) – Pramod Oct 16 '12 at 4:46
  • Added your error message to the question. I'm not certain about this one. – Lyndon Vrooman Oct 16 '12 at 16:18
2

try this method its working fine for me.....

capabilities = new DesiredCapabilities();   capabilities.setBrowserName("opera");               capabilities.setCapability("opera.autostart ",true);

driver = new RemoteWebDriver(server, capabilities);
driver.get("http://google.com/");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.