博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Appium对手机chrome浏览器操作
阅读量:6974 次
发布时间:2019-06-27

本文共 826 字,大约阅读时间需要 2 分钟。

appium操作chrome浏览器

1.安卓手机下载手机版chrome浏览器

Appium对手机chrome浏览器操作
2.Andriod setting中选择“chrome”
Appium对手机chrome浏览器操作
3.通过css定位得到百度输入框为:#index-kw
Appium对手机chrome浏览器操作
4.编写代码
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

你可能感兴趣的文章
Java 二进制,八进制,十进制,十六进制转换
查看>>
PHP7语法知识(四):目录文件操作、Cookie与Session、MySQL数据库的使用、Redis数据库、PHP处理XML与JSON...
查看>>
bzoj1212
查看>>
Datawhale编程——队列
查看>>
Bzoj3597: [Scoi2014]方伯伯运椰子
查看>>
LOJ #2985. 「WC2019」I 君的商店
查看>>
CSS 基本知识
查看>>
JSON数据传递
查看>>
用Python将word文件转换成html(转)
查看>>
移动widget开发
查看>>
CentOS 6.8 安装Tomcat7
查看>>
Nginx 502 bad gateway问题的解决方法
查看>>
11. Container With Most Water - Medium
查看>>
解决Android中图片圆角——.9图
查看>>
retain和copy的区别 #import @class 的区别
查看>>
CSS基础语法
查看>>
N皇后问题
查看>>
springboot热部署
查看>>
MySQL学习(五) UNION与UNION ALL
查看>>
爬虫_淘宝(selenium)
查看>>