【发布时间】:2018-09-22 05:43:45
【问题描述】:
硒: 3.0.0
chromedriver: 2.36
Appium: 1.7.2
Android Chrome 浏览器:65.0.32..
要求:
场景1:
1.打开手机浏览器页面
2.单击一个按钮
3.现在应该会显示 android Google playstore 屏幕。
4.再次回到手机浏览器。
场景 2:
1.打开手机浏览器页面
2.单击一个按钮
3.现在应该会显示安卓短信了。
4.再次回到手机浏览器。
public class KindleModule extends LaunchApp {
public static void main(String[] args) throws MalformedURLException, InterruptedException {
// TODO Auto-generated method stub
LaunchApp app = new LaunchApp();
AndroidDriver<AndroidElement> driver=capabilities();
//WebDriver driver;
driver.get("https:abc");
System.out.println("application launched");
Thread.sleep(5000);
driver.findElement(By.xpath(".//*[@id='abc']/div/")).click();
Thread.sleep(2000);
//after clicking this button i want to navigate to playstore because example kindle app is not present and after that i want to come back:
driver.findElement(By.xpath(".//*[@id=abcPopup']/button")).click();
Activity activity = new Activity("appPackage", "appActivity");
//redirect to the Activity
driver.startActivity(activity);
}
}
请问有人可以帮忙吗?
【问题讨论】:
标签: java android selenium selenium-webdriver appium