Appium BasicKeywords - 18570580798/study GitHub Wiki

WM Is Element Present [Arguments] ${locator} @{list} Get Webelements ${locator} ${len}= Get Length ${list} ${ret}= Set Variable If ${len}>0 ${True} ${False} [Return] ${ret}

WM Swipe Down And Click Element In Native [Arguments] ${locator} ${page_num}=10 : FOR ${i} IN RANGE ${page_num} \ ${status} Run Keyword And Return Status Wait Until Page Contains Element ${locator} 3 \ run keyword if '${status}'=='${True}' run keywords click element ${locator} \ ... AND Exit For Loop \ ... ELSE Swipe By Percent 50 80 50 \ ... 20 1000

WM Swipe Down And Click Element In Webview [Arguments] ${locator} ${page_num}=10 : FOR ${i} IN RANGE ${page_num} \ ${status} Run Keyword And Return Status Wait Until Page Contains Element ${locator} 3 \ run keyword if '${status}'=='${True}' run keywords click element ${locator} \ ... AND Exit For Loop \ ... ELSE Execute Javascript document.documentElement.scrollTop=document.body.scrollHeight-document.documentElement.clientHeight

WM Operate WX Widget [Arguments] @{kw} Switch To Context ${MC_PID.native} sleep 2 run keyword @{kw} ${contexts} get_contexts ${current_context} get_current_context log ${contexts} log ${current_context} sleep 2 Switch To Context ${MC_PID.webview} ${current_context} get_current_context log ${current_context}

WM Set Checkbox [Arguments] ${locator} ${boolean} wait until page contains element ${locator} wait until element is visible ${locator} run keyword if ${boolean}==${True} Select Checkbox ${locator} ... ELSE Unselect Checkbox ${locator}

WM Tear Down Close Application Run Keyword And Ignore Error Should Be Empty ${FAILED_PRODUCT_CODE} 以下为无效商品条码:${FAILED_PRODUCT_CODE}

WM Get System Variable [Arguments] ${env_name} ${status} Run Keyword And Return Status Environment Variable Should Be Set ${env_name} ${value} Run Keyword If '${status}'=='${True}' Get Environment Variable ${env_name} [Return] ${value}

WM Get Now Time ${yyyy} ${mm} ${dd} Get Time year,month,day ${now_time} Set Variable ${yyyy}/${mm}/${dd} [Return] ${now_time}

WM Log Contests ${contexts} get_contexts ${current_context} get_current_context log ${contexts} log ${current_context}