当前位置:   article > 正文

慕课网自动化登录测试脚本_自动化测试慕课网测试用例

自动化测试慕课网测试用例

创建一个maven工程

导入selenium依赖项

打开pom.xml文件,导入以下依赖:

  1. <dependencies>
  2. <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
  3. <dependency>
  4. <groupId>org.seleniumhq.selenium</groupId>
  5. <artifactId>selenium-java</artifactId>
  6. <version>3.4.0</version>
  7. </dependency>
  8. </dependencies>

慕课登录自动化测试

本文实在谷歌浏览器上实现的自动化登录测试,在编写代码之前先检查是否下载了谷歌驱动器。具体代码如下:

  1. import org.openqa.selenium.By;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.WebElement;
  4. import org.openqa.selenium.chrome.ChromeDriver;
  5. import org.openqa.selenium.interactions.Actions;
  6. public class muke_login {
  7. p
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/878772
推荐阅读
相关标签
  

闽ICP备14008679号