当前位置: 首页 > news >正文

联客易网站建设制作如何选择企业网站建设公司

联客易网站建设制作,如何选择企业网站建设公司,百度竞价最低点击一次多少钱,加密软件代理自动化博客项目 用户注册登录验证效验个人博客列表页博客数量不为 0 博客系统主页写博客 我的博客列表页效验 刚发布的博客的标题和时间查看 文章详情页删除文章效验第一篇博客 不是 自动化测试 注销退出到登录页面,用户名密码为空 用户注册 Order(1)Parameterized… 自动化博客项目 用户注册登录验证效验个人博客列表页博客数量不为 0 博客系统主页写博客 我的博客列表页效验 刚发布的博客的标题和时间查看 文章详情页删除文章效验第一篇博客 不是 自动化测试 注销退出到登录页面,用户名密码为空 用户注册 Order(1)ParameterizedTestCsvFileSource(resources regmes.csv)void Reg(String username , String password , String password2) throws InterruptedException {webDriver.get(http://211.159.172.237:8080/reg.html);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//输入注册名webDriver.findElement(By.cssSelector(#username)).sendKeys(username);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//输入密码webDriver.findElement(By.cssSelector(#password)).sendKeys(password);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//输入确认密码webDriver.findElement(By.cssSelector(#password2)).sendKeys(password2);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);sleep(2000);//点击注册webDriver.findElement(By.cssSelector(#submit)).click();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);sleep(2000);webDriver.switchTo().alert().accept();登录验证 Order(2)ParameterizedTestCsvFileSource(resources LoginSuccess.csv)void LoginSuccess(String username , String password , String blog_list_url) throws InterruptedException {//打开登录页webDriver.get(http://211.159.172.237:8080/login.html);webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);//输入账号webDriver.findElement(By.cssSelector(#username)).sendKeys(username);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);webDriver.findElement(By.cssSelector(#password)).sendKeys(password);webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);sleep(3000);webDriver.findElement(By.cssSelector(#submit)).click();webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);sleep(1000);//验证urlString cur_url webDriver.getCurrentUrl();Assertions.assertEquals(blog_list_url, cur_url);}效验个人博客列表页博客数量不为 0 Order(3)Test//效验 个人博客列表页博客数量不为 0void MyBlogList() throws InterruptedException {webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);sleep(3000);int title_num webDriver.findElements(By.cssSelector(.title)).size();Assertions.assertNotEquals(0,title_num);}博客系统主页 写博客 Order(4)Testvoid AddBlog() throws InterruptedException {//到系统主页看看webDriver.findElement(By.cssSelector(body div.nav a:nth-child(4))).click();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);sleep(3000);//写博客webDriver.findElement(By.cssSelector(body div.nav a:nth-child(5))).click();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//通过js输入((JavascriptExecutor)webDriver).executeScript(document.getElementById(\title\).value\自动化测试\);sleep(1500);//点击发布webDriver.findElement(By.cssSelector(body div.blog-edit-container div.title button)).click();sleep(1500);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//弹窗点击取消webDriver.switchTo().alert().dismiss();String cur_url webDriver.getCurrentUrl();Assertions.assertEquals(http://211.159.172.237:8080/myblog_list.html,cur_url);sleep(1500);// webDriver.switchTo().alert().accept();} 我的博客列表页 效验 刚发布的博客的标题和时间 Order(5)Test//效验已发布博客的标题和时间void BlogInfoChecked() throws InterruptedException {webDriver.get(http://211.159.172.237:8080/myblog_list.html);String first_blog_title webDriver.findElement(By.cssSelector(#artListDiv div:nth-child(1) div.title)).getText();String first_blog_time webDriver.findElement(By.xpath(//*[id\artListDiv\]/div[1]/div[2])).getText();Assertions.assertEquals(自动化测试,first_blog_title);sleep(3000);if(first_blog_time.contains(2023-10-28)) {System.out.println(时间正确);}else {System.out.println(当前时间是 : first_blog_time);System.out.println(时间错误);}}查看 文章详情页 TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class BlogCases extends InitAndEnd{public static StreamArguments Generator() {return Stream.of(Arguments.arguments(http://211.159.172.237:8080/blog_content.html,博客正文,自动化测试));}Order(6)ParameterizedTestMethodSource(Generator)//博客详情页void BlogContent(String expected_url , String expected_title , String expected_blog_title) throws InterruptedException {webDriver.findElement(By.xpath(//*[id\artListDiv\]/div[1]/a[1])).click();sleep(3000);//获取当前页面的url , http://211.159.172.237:8080/blog_content.html?aid15String cur_url webDriver.getCurrentUrl();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//获取当前页面的标题 , 博客正文String cur_title webDriver.getTitle();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);//获取当前博客的标题 , 自动化测试String blog_title webDriver.findElement(By.cssSelector(#title)).getText();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);// Assertions.assertEquals(expected_url , cur_url);Assertions.assertEquals(expected_title , cur_title);Assertions.assertEquals(expected_blog_title , blog_title);if(cur_url.contains(expected_url)) {System.out.println(博客详情正确);} else {System.out.println(cur_url);System.out.println(博客详情失败);}sleep(1500);}删除文章 效验第一篇博客 不是 “自动化测试” Order(7)Test//删除刚刚发布的博客void DeleteBlog() throws InterruptedException {webDriver.get(http://211.159.172.237:8080/myblog_list.html);webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);webDriver.findElement(By.cssSelector(#artListDiv div:nth-child(1) a:nth-child(6))).click();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);sleep(3000);webDriver.switchTo().alert().accept();//效验第一篇博客不是 自动化测试String first_blog_title webDriver.findElement(By.cssSelector(#artListDiv div:nth-child(1) div.title)).getText();webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.SECONDS);Assertions.assertNotEquals(自动化测试,first_blog_title);sleep(3000);}注销 Order(8)Test//注销void Logout() throws InterruptedException {webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); // webDriver.findElement(By.cssSelector(body div.nav a:nth-child(6)));webDriver.findElement(By.xpath(/html/body/div[1]/a[3])).click();webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);webDriver.switchTo().alert().accept();sleep(3000);String cur_url webDriver.getCurrentUrl();Assertions.assertEquals(http://211.159.172.237:8080/login.html,cur_url);}退出到登录页面,用户名密码为空
http://www.w-s-a.com/news/23425/

相关文章:

  • 制作广告网站的步骤云服务器做网站
  • ipv6可以做网站吗东莞网站建站推广
  • 注册功能的网站怎么做做网站容易还是编程容易
  • wordpress建立目录seo编辑培训
  • 网站怎么群发广州现在可以正常出入吗
  • 微信有网站开发吗多语种网站
  • 深圳网站设计 建设首选深圳市室内设计公司排名前50
  • 上海网站建设 觉策动力wordpress接口开发
  • 网站建设服务器的选择方案小型视频网站建设
  • 江宁做网站价格扬州立扬计算机培训网站建设怎么样
  • 手表网站背景开发新客户的十大渠道
  • 定制网站设计wordpress写的网站
  • p2p网站建设公司排名成都装饰公司
  • 网站被k怎么恢复wordpress缓存类
  • 做外贸有哪些网站平台最近文章 wordpress
  • joomla网站模板一个人做网站的swot
  • 南京建设网站需要多少钱深圳专业网站建设制作价格
  • 天河建网站装修公司线上推广方式
  • 超市网站怎么做的目前最流行的拓客方法
  • 做文字logo的网站贵阳商城网站开发
  • 沧州有没有做网站的中国建筑设计
  • 建设网站 系统占用空间在线代理浏览网站
  • 做海报有什么参考的网站网站建设验收合同
  • 酒店网站制作wordpress文章评论设置
  • 造一个官方网站wordpress mysql类
  • 怎么做卡商网站河南做网站找谁
  • 网站建设招标方案模板上线啦 图谱智能网站
  • 龙口网站建设公司哪家好wordpress 上传类型
  • 做外贸主要看什么网站服务平台的宗旨
  • 宜昌营销型网站购买网站