本文共 826 字,大约阅读时间需要 2 分钟。
appium操作chrome浏览器
1.安卓手机下载手机版chrome浏览器
2.Andriod setting中选择“chrome”3.通过css定位得到百度输入框为:#index-kw4.编写代码import io.appium.java_client.AppiumDriver;import io.appium.java_client.TouchAction;import org.junit.*;
import org.junit.Before;import org.junit.Test;import org.openqa.selenium.By;import org.openqa.selenium.WebElement;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilities;import org.openqa.selenium.remote.RemoteWebDriver;import org.openqa.selenium.WebDriver;public class chrome { private AppiumDriver driver;private static WebElement element = null;int port=22;String url="";"), capabilities);}
@After
public void tearDown() throws Exception { ");driver.findElementByCssSelector("#index-kw").sendKeys("suzhou");}}转载于:https://blog.51cto.com/11959730/2136265