zoukankan      html  css  js  c++  java
  • 自动化测试随笔4-无法点击底部的完成按钮

    自动化脚本-在新增产品的时候 无法点击底部的完成按钮,几种方法总结如下:
     1 //点击完成按钮方法1
     2 // Actions action = new Actions(driver);
     3 // WebElement Element2 = Common.scrollToElement(driver,By.xpath("//*[@id='productDetailAddForm']/div/div[18]/button"));
     4 // action.moveToElement(Element2).click().perform();
     5 *****************************************
     6 //点击完成按钮一般方法
     7 // Thread.sleep(3000);
     8 // Common.scrollToElement(driver,By.xpath("//*[@id='productDetailAddForm']/div/div[18]/button")).click();
     9 ****** ******************************************************
    10 /* 点击完成按钮方法2
    11 WebElement h = Common.scrollToElement(driver, By.className("//ng-scope"));
    12 WebElement head = h.findElement(By.id("productDetailAddForm"));
    13 head.findElement(By.xpath("//div/div[18]")).click();
    14 */
    15 **********************************************************************************
    16 //完成按钮在页面底端,一般方法无法实现点击,所以改为以下实现点击完成
    17 WebElement Element = Common.scrollToElement(driver,By.xpath("//*[@id='productDetailAddForm']/div/div[18]/button"));
    18 Element.sendKeys(Keys.ARROW_DOWN);
    19 if(!Element.isSelected()) {
    20 Element.click();
    21 Thread.sleep(1000);
    22 }
  • 相关阅读:
    《DSP using MATLAB》Problem 8.9
    《DSP using MATLAB》Problem 8.8
    PID库与PID基本优化(四)
    PID库与PID基本优化(三)
    PID库与PID基本优化(二)
    PID库与PID基本优化(一)
    Mahony姿态解算算法笔记(二)
    《理解矩阵》笔记
    Mahony姿态解算算法笔记(一)
    洛谷p1082 同余方程
  • 原文地址:https://www.cnblogs.com/by170628/p/7120821.html
Copyright © 2011-2022 走看看