一个简单的139邮箱登录脚本--->java-selenium
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class demo {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver dr;
System.setProperty("webdriver.Chrome.mariontte","C:\\driver\\chromedriver.exe");
dr= new ChromeDriver();
dr.get("http://mail.10086.cn");
dr.manage().window().maximize();
//dr.get(Context_variables.url);
WebElement username = dr.findElement(By.id("txtUser"));
WebElement pwd = dr.findElement(By.id("txtPass"));
WebElement Btn = dr.findElement(By.id("cbauto"));
WebElement login = dr.findElement(By.id("loginBtn"));
username.sendKeys("账号");
pwd.sendKeys("密码");
Btn.click();
login.click();
}
}
最新文章
- 创建django项目
- Tomcat下使用war包发布项目
- 苹果开发者账号如何多人协作进行开发和真机调试XCode
- python递归小疑惑
- appium的xpath定位
- [Java Code] 时间维度循环生成代码片段
- Balanced Numbers(数位+状压)
- 实现VS2010整合NUnit进行单元测试
- 一步步优化JVM二:JVM部署模型和JVM Runtime
- Struts2基础学习(八)—Struts2防止表单重复提交
- spring boot / cloud (七) 使用@Retryable来进行重处理
- RabbitMQ权限控制原理
- spring 框架学习网站
- MySQL学习(五) UNION与UNION ALL
- windows模拟linux部分功能
- ajax hash缓存
- Service 保活法之二
- 好用的 FTP 软件之 FileZilla 技巧教程
- 【mysql】mysql中单列索引、联合索引、Join联表查询建立索引 和 EXPLAIN的分析使用
- 浅析promise
热门文章
- Apache Maven的下载、安装、测试
- hdu-3592 World Exhibition(差分约束)
- [SHOI 2013] 发微博
- Balancing Act(树的重心)
- JS 之正则表达式
- docker使用问题
- View Controller Programming Guide for iOS---(六)---Responding to Display-Related Notifications
- html中target的用法
- 从ao神处偷取的头文件
- bzoj 5019: [Snoi2017]遗失的答案【dp+FWT】