Reputation: 1
Well,guys here just only show the examply in python. i can not code it in java with the same example.
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option('androidPackage', 'com.android.chrome')
driver = webdriver.Chrome('./chromedriver', options=options)
driver.get('https://google.com')
driver.quit()
any advice
Upvotes: 0
Views: 187
Reputation: 193308
The Java equivalent code will be:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOptions("androidPackage", "com.android.chrome");
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");
driver.quit();
Upvotes: 0