diff --git a/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java b/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java index 667dd014c1c3..db70a4a293c8 100644 --- a/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java +++ b/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java @@ -70,11 +70,17 @@ public void internetExplorerCompatibilitySession() { @Disabled("Requires non-standard browser") @Test public void operaSession() { - ChromeOptions options = new ChromeOptions(); - options.setBinary("/path/to/opera/browser"); - - driver = new ChromeDriver(options); - + // Set webdriver.chrome.driver with Opera Driver + System.setProperty("webdriver.chrome.driver", "OPERA_DRIVER_PATH"); + // Create ChromeOptions Instance + chromeOptions = new ChromeOptions(); + // Set W3C Dialect + chromeOptions.setExperimentalOption("w3c", true); + // Create ChromeDriver Instance + driver = new ChromeDriver(chromeOptions); + // Open Target Website + driver.get("https://www.selenium.dev"); + // Quit driver.quit(); } diff --git a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.en.md b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.en.md index e111ed48bb1f..39ab821efed6 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.en.md @@ -274,18 +274,24 @@ Microsoft Edge can be used in IE compatibility mode using the IE Driver. ## Opera -Since the opera driver does not support w3c syntax, but is based on Chromium, it is recommended +Since the opera driver does not set w3c as default value, but is based on Chromium, it is recommended to drive Opera browser with the chromedriver. Like all Chromium implementations, make sure that the browser version matches the driver version. {{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L78">}} - ChromeOptions options = new ChromeOptions(); - options.setBinary("/path/to/opera/browser"); - - driver = new ChromeDriver(options); - - driver.quit(); + {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L84">}} + // Set webdriver.chrome.driver with Opera Driver + System.setProperty("webdriver.chrome.driver", "OPERA_DRIVER_PATH"); + // Create ChromeOptions Instance + ChromeOptions chromeOptions = new ChromeOptions(); + // Set W3C Dialect + chromeOptions.setExperimentalOption("w3c", true); + // Create ChromeDriver Instance + WebDriver driver = new ChromeDriver(chromeOptions); + // Open Target Website + driver.get("https://www.selenium.dev"); + // Quit + driver.quit(); {{< /tab >}} {{< tab header="Python" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/python/tests/getting_started/test_open_browser.py#L49-L53" >}} options = ChromeOptions() @@ -344,7 +350,7 @@ safaridriver --enable ``` {{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L84-L88">}} +{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L90-L94">}} SafariOptions options = new SafariOptions(); driver = new SafariDriver(options); diff --git a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.ja.md index e41d0383fed8..53991c0404da 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.ja.md @@ -275,17 +275,23 @@ Microsoft Edge can be used in IE compatibility mode using the IE Driver. ## Opera -Since the opera driver does not support w3c syntax, but is based on Chromium, it is recommended -to drive Opera browser with the chromedriver. Like all Chromium implementations, +Since the opera driver does not set w3c as default value, but is based on Chromium, it is recommended +to drive Opera browser with the chromedriver. Like all Chromium implementations, make sure that the browser version matches the driver version. {{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L78">}} - ChromeOptions options = new ChromeOptions(); - options.setBinary("/path/to/opera/browser"); - - driver = new ChromeDriver(options); - + {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L84">}} + // Set webdriver.chrome.driver with Opera Driver + System.setProperty("webdriver.chrome.driver", "OPERA_DRIVER_PATH"); + // Create ChromeOptions Instance + ChromeOptions chromeOptions = new ChromeOptions(); + // Set W3C Dialect + chromeOptions.setExperimentalOption("w3c", true); + // Create ChromeDriver Instance + WebDriver driver = new ChromeDriver(chromeOptions); + // Open Target Website + driver.get("https://www.selenium.dev"); + // Quit driver.quit(); {{< /tab >}} {{< tab header="Python" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/python/tests/getting_started/test_open_browser.py#L49-L53" >}} @@ -345,7 +351,7 @@ safaridriver --enable ``` {{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L84-L88">}} +{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L90-L94">}} SafariOptions options = new SafariOptions(); driver = new SafariDriver(options); diff --git a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.pt-br.md index 73135f9c1332..a6238f5ef5ce 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.pt-br.md @@ -267,17 +267,23 @@ O Microsoft Edge pode ser usado no modo de compatibilidade do IE usando o Driver ## Opera -Como o driver opera não suporta a sintaxe w3c, mas é baseado no Chromium, é recomendado +Porque o driver opera não define W3C como a sintaxe padrão, mas é baseado no Chromium, é recomendado utilizar o navegador Opera com o chromedriver. Assim como todas as implementações do Chromium, certifique-se de que a versão do navegador corresponda à versão do driver. {{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L78">}} - ChromeOptions options = new ChromeOptions(); - options.setBinary("/path/to/opera/browser"); - - driver = new ChromeDriver(options); - + {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L84">}} + // Set webdriver.chrome.driver with Opera Driver + System.setProperty("webdriver.chrome.driver", "OPERA_DRIVER_PATH"); + // Create ChromeOptions Instance + ChromeOptions chromeOptions = new ChromeOptions(); + // Set W3C Dialect + chromeOptions.setExperimentalOption("w3c", true); + // Create ChromeDriver Instance + WebDriver driver = new ChromeDriver(chromeOptions); + // Open Target Website + driver.get("https://www.selenium.dev"); + // Quit driver.quit(); {{< /tab >}} {{< tab header="Python" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/python/tests/getting_started/test_open_browser.py#L49-L53" >}} @@ -337,7 +343,7 @@ safaridriver --enable ``` {{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L84-L88">}} +{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L90-L94">}} SafariOptions options = new SafariOptions(); driver = new SafariDriver(options); diff --git a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.zh-cn.md index 43dcee465fb4..c6a328e14a4d 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/open_browser.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/open_browser.zh-cn.md @@ -276,17 +276,23 @@ Internet Explorer 11将于2022年6月15日终止对包括Windows 10在内的某 ## Opera -由于opera驱动程序不支持w3c语法, +由于opera驱动程序未设置w3c为默认语法, 但基于Chrome, 因此建议使用chromedriver驱动opera浏览器. 与所有Chromium实现一样, 确保浏览器版本与驱动程序版本匹配. {{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L78">}} - ChromeOptions options = new ChromeOptions(); - options.setBinary("/path/to/opera/browser"); - - driver = new ChromeDriver(options); - + {{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L73-L84">}} + // Set webdriver.chrome.driver with Opera Driver + System.setProperty("webdriver.chrome.driver", "OPERA_DRIVER_PATH"); + // Create ChromeOptions Instance + ChromeOptions chromeOptions = new ChromeOptions(); + // Set W3C Dialect + chromeOptions.setExperimentalOption("w3c", true); + // Create ChromeDriver Instance + WebDriver driver = new ChromeDriver(chromeOptions); + // Open Target Website + driver.get("https://www.selenium.dev"); + // Quit driver.quit(); {{< /tab >}} {{< tab header="Python" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/python/tests/getting_started/test_open_browser.py#L49-L53" >}} @@ -347,7 +353,7 @@ safaridriver --enable ``` {{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L84-L88">}} +{{< tab header="Java" github="SeleniumHQ/seleniumhq.github.io/blob/dev/examples/java/src/test/java/dev/selenium/getting_started/OpenBrowserTest.java#L90-L94">}} SafariOptions options = new SafariOptions(); driver = new SafariDriver(options);