zoukankan      html  css  js  c++  java
  • 自动化测试工具-Katalon Studio

     
     
     
     
     

    Katalon 代码片段:

    1)if(WebUI.verifyTextPresent(findTestObject('Page_Skin/p_Are you ok?'),10,FailureHandling.CONTINUE_ON_FAILURE)) 表达式未获取到true或者false值;

    2) if(WebUI.waitForElementPresent(findTestObject('Page_Skin/Continue Seds'),10,FailureHandling.OPTIONAL)) 表达式可以获取到true或者false值; 

    3) 测试Demo:

    WebUI.openBrowser('')

    WebUI.navigateToUrl('https://www.hehe.org/')

    WebUI.verifyElementVisible(findTestObject('Page_Skin_1cc4a1/span_LoginSign up'))

    WebUI.click(findTestObject('Page_Skin_1cc4a1/span_LoginSign up'))

    WebUI.setText(findTestObject('Page_SkinHehe_1cc4a1/input'), '207@ccwwwaa.com')

    WebUI.setText(findTestObject('Page_SkinHehe_1cc4a1/input_1'), '123456')

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_LOGIN'))

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_Wrinkles, Texture, Pores'))

    WebUI.click(findTestObject('Page_SkinHehe_e46d5e/span_Get Treatment'))

    WebUI.click(findTestObject('Page_SkinHehe_e46d5e/span_Add  Continue'))

    WebUI.waitForPageLoad(5)

    // Skin buy something flow

    if(WebUI.waitForElementPresent(findTestObject('Page_SkinHehe_1cc4a1/radio3c'),

    2,FailureHandling.OPTIONAL)) {

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/radio1a'))

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_Next'))

    }else {

    println 'ques radio1'

    }

    for(int i =0;i<10;i=i+1) {

    if(WebUI.waitForElementPresent(findTestObject('Page_SkinHehe_1cc4a1/radio2b'),

    2,FailureHandling.OPTIONAL)) {

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/radio2b'))

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_Next'))

    }else {

    println 'ques radio2b not shown'

    }

    if(WebUI.waitForElementPresent(findTestObject('Page_SkinHehe_1cc4a1/textarea'),

    2,FailureHandling.OPTIONAL)) {

        WebUI.setText(findTestObject('Page_SkinHehe_1cc4a1/textarea'), '0001')

    if(WebUI.waitForElementPresent(findTestObject('Page_SkinHehe_1cc4a1/textarea2'),

    2,FailureHandling.OPTIONAL)) {

        WebUI.setText(findTestObject('Page_SkinHehe_1cc4a1/textarea2'), '0002')

    }

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_Next'))

    }else {

    println 'ques textarea'

    }

    if(WebUI.waitForElementPresent(findTestObject('Page_SkinHehe_1cc4a1/checkbox1'),

    2,FailureHandling.OPTIONAL)) {

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/checkbox1'))

    WebUI.click(findTestObject('Page_SkinHehe_1cc4a1/span_Next'))

    }else {

    println 'ques cb textarea'

    }

    }

  • 相关阅读:
    CF 640(div4)
    ABC 166
    CF 637 div2
    HDU-1875 畅通工程再续
    POJ1251-Jungle Roads
    POJ1797 Heavy Transportation
    Gym-101911K Medians and Partition
    Gym-101911A Coffee Break
    【Vue】Re09 Webpack 第一部分(介绍、安装、配置)
    【Vue】Re08 模块化
  • 原文地址:https://www.cnblogs.com/jiguanghover/p/14993032.html
Copyright © 2011-2022 走看看