Launch Opera browser using selenium

package browsers;
import org.testng.annotations.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.testng.annotations.BeforeTest;

public class OperaBrowser {
    WebDriver driver;

    @Test
    public void launchOperaBrowser() throws Exception {
        driver.get("http://www.seleniumlearn.com");
    }

    @BeforeTest
    public void beforeTest() {
       // driver = new OperaDriver();

        System.setProperty("webdriver.opera.driver","D:\\lib\\operadriver.exe");  //--->Operadriver path
        driver=new OperaDriver();

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

    }

}

Comments