摘要: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDr 阅读全文
posted @ 2021-08-15 01:44 测试长流 阅读(100) 评论(0) 推荐(0)
摘要: 实现功能如下: 1. 通过id定位,用户名输入框、密码输入框、登录按钮 2. 登录后实现一个xpath索引定位 代码如下: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.s 阅读全文
posted @ 2021-08-12 18:03 测试长流 阅读(248) 评论(0) 推荐(0)
摘要: selenium的webdriver提供了以下八种基本的元素定位方法: 1、通过id定位:findElement(By.id());2、通过name定位:findElement(By.name());3、通过class定位:findElement(By.className());4、通过tag定位: 阅读全文
posted @ 2021-08-12 15:06 测试长流 阅读(386) 评论(0) 推荐(0)
摘要: 1. maven项目下src/main/java路径新建java类,代码如下: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeD 阅读全文
posted @ 2021-08-11 17:36 测试长流 阅读(1688) 评论(0) 推荐(0)
摘要: 在Idea中创建maven项目 在pom.xml中添加如下依赖: <dependencies> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <versio 阅读全文
posted @ 2021-08-11 15:33 测试长流 阅读(1332) 评论(0) 推荐(0)