Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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

share|improve this question
    
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 Kumar G 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

1 Answer 1

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/");
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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