赞
踩
打开pom.xml文件,导入以下依赖:
- <dependencies>
- <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- <version>3.4.0</version>
- </dependency>
-
- </dependencies>
本文实在谷歌浏览器上实现的自动化登录测试,在编写代码之前先检查是否下载了谷歌驱动器。具体代码如下:
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.chrome.ChromeDriver;
- import org.openqa.selenium.interactions.Actions;
-
- public class muke_login {
- p
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。