Settings * * *Library appiumlibrarylibrary autoitlibrarylibrary osKeywords * * *XPath should match the number of times [Arguments] ${xpath} ${count} XPath should match X Times ${xpath} ${count} upload file [Argum Ents] ${path} ${data} ${encode}=base64 Push File ${path} ${data} ${encode} element should not contain text [Arguments] ${locator} ${expected} ${msg}< /c2>=Element should notcontain Text ${locator} ${expected} ${msg} element value should be [Arguments] ${locator} ${expected} elements Valu E should be ${locator} ${expected} element name should be [Arguments] ${path} ${name} element name should be ${path} ${name} element attribute should match [Arguments] ${locator} ${attr_name} ${match_pattern} ${regx}=False element Attribute should Match ${locator} ${attr_name} ${match_pattern} ${REGX} elements should contain text [Argum Ents] ${locator} ${expected} ${msg}=None element should contain Text ${locator} ${expected} ${msg} elements should fail [Arguments] ${locator} ${lev El}=INFO element should be disabled ${locator} ${level} element should be valid [Arguments] ${locator} ${level}=INFO element should be enabled ${locator} ${level} element text should be [Arguments] ${locator} ${expected} ${ms G}=None Element Text should be ${locator} ${expected} ${msg} closes the current app close application shut down all apps close all Ap plications switch App [Arguments] ${index_or_alias} switch application ${index_or_alias} Toggle page content [Arguments] ${we bview} Switch to Context ${webview} uninstall App [Arguments] ${application_id} Remove application ${application_i D} background Run [Arguments] ${sec} Background App ${sec} scroll up [Arguments] ${locator} Scroll up ${locator} roll down [Arguments] ${locator} Scroll down ${locator} failed to run the keyword [Arguments] ${keyword} [documentation] Exa Mple:#disables Run-on-failure functionality and stores the previous KW name in a variable. # Restore to the previous keyword. ... ... Register Keyword to Run on Failure \ \ \ Log Source ... \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#Run ' Log Source ' on failure.... ${previous kw}= ... Register Keyword to Run on Failure \ \ Nothing ..... Register Keyword to run on Failure \ \ \ ${previous kw} \ \ Register Keyword to run on Failure ${keyword} print Resource [Arguments] ${level} Log Source ${level} open URL [Arguments] ${url} [documentation] Example: ... ... Open app ... http:Localhost:4755/wd/hub \ Platformname=ios \ platformversion=7.0. .. devicename='IPhone Simulator'. .. browsername=Safari ... Open URL \ http://m.webapp.com Go to URL ${url} open App [Arguments] ${url} ${platformname} ${version} ${devicename} ${app} [documentation] open app ${url} ${platformname} ${version} \ \ ${devicename} ${app} @{args} ... For example:...... Open App http:Localhost:4723/wd/hub Android 5.1.1 5e25d20d ${curdir}${/}app${/}fft.apk. ${url} is the address used to access the app, which is generally fixed. URLs and ports can be modified according to the specific address. ... ${version} \ is the version of Android ... ${devicename} is the udid of the phone, you can open cmd and then use ADB devices-l \ See List of devices. ... UDID is the first column to see the contents of the real machine is a string of strings, the simulator is \ ip:port \ The form of ... ${app} is the path of the APK storage ${curdir} system variable, get the current script path. ${/} System Variables'/'Open Application ${url} platformname=${platformname} platformversion=${version} Devicename=${devicename} app=${app} by keyword [Arguments] ${keycode} ${metastate}=None Press KeyCode ${keycode} ${metastate} shaking phone shake magnification element [Arguments] ${locator} ${percent}=200% ${step}=1Zoom ${locator} ${percent} ${step} percussion element [Arguments] ${locator} Tap ${locator} horizontal screen [Documentat ION] Phone Set horizontal screen landscape clear text [Arguments] ${locator} clear text ${locator} slide [Arguments] ${start_x} ${start_y} ${end_x} ${end_y} swipe ${start_x} ${start_y} ${end_x} ${end_y} scrolling [Arguments] ${sta Rt_locator} ${end_locator} [documentation] scrolls from one element to another Scroll ${start_locator} ${end_locator} click on element [ Arguments] ${locator} click Element ${locator} clicking on the elements coordinates [Arguments] ${coordinate_x} ${coordinate_y} Clic K Element at coordinates ${coordinate_x} ${coordinate_y} Click fixed Point [Arguments] ${x} ${y} @{args} click A P Oint ${x} ${y} @{args} click button [Arguments] ${index_or_name} Click Button ${index_or_name} tap text [Argumen TS] ${text} ${exact_match}=false [documentation] Click on the element that matches to the text: ... Click Text"text" ... Click Text"text"True ... The default blur matches all elements and can be set to exact matches. ... If you can match two or more two elements, you need to use the click Element to handle it. Click Text ${text} ${exact_match} sleeping [Arguments] ${sec} sleep ${sec} vertical screen portrait wait for page element to appear [Arguments] ${locator} ${timeout}=100 ${err}=None wait Until Page Contains element ${locator} ${timeout} ${err} waits for element to appear text [Arguments] ${text} ${ Timeout}=10 ${err}=None Wait Until page Contains ${text} ${timeout} ${err} waiting pages do not contain elements [Arguments] ${locator} ${timeout }=10 ${err}=None Wait Until page Does not contain Element ${locator} ${timeout} ${err} waiting pages do not contain text [Arguments] ${te XT} ${timeout}=10 ${err}=None Wait Until Page Does not contain ${text} ${timeout} ${err} shrink element [Arguments] ${locator} ${PERC ENT}=200% ${step}=1Pinch ${locator} ${percent} ${step} get Appium time Out ${timeout} get Appium timeout [Return] ${time Out} gets the Web element [Arguments] ${locator} [documentation] Gets the first element of a matching locator: ... ${element} gets the Web element ID=name ... Click Element ${element} ${element} get Webelement ${locator} [Return] ${element} get element coordinates [Arguments] ${locator} ${location} Get element location ${locator} [Return] ${location} get Dimension [Arguments] ${locator} ${s ize} Get element Size ${locator} [Return] ${size} get elements Property [Arguments] ${locator} ${name_or_value} [D Ocumentation] Gets the element attribute: (name or value) ... ${val} \ Get element property ${locator} ${name_or_value} ... For example: ... ${val} get element Property ID=xxxx name ... ${val} get element Property ID=xxxx value ${val} get Element Attribute ${locator} ${name_or_value} [Return] ${val} Get matching XPath number [Ar Guments] ${xpath} [documentation] For example: ... ${count} \ \ \ Get matching XPath number \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \android.view.view[@text ='Test'] ${count} get Matching Xpath count ${xpath} [Return] ${count} get visible text ${contents} get contexts [Return] ${contents} get current text ${context} Get present context [Return] ${context} Get all web elements [Arguments] ${ locator} [documentation] @{element} Get all Web element IDs=my_element ... Click on the element @{element}[2] @{element} get webelements ${locator} [Return] @{element} get file [Arguments] ${file_path} ${dec ODE}=False pull file ${file_path} ${decode} get folder [Arguments] ${folder_path} ${decode}=False pull Folder ${folder_path} ${decode} gets the text [Arguments] ${locator} [documentation] Gets the text that conforms to the element: ... ${text} \ get text \*[contains (@text,'Foo')] ${text} get text ${locator} [Return] ${text} Get network connection Condition ${stat} Get networks Connection status [Return] ${stat} get resource ${source} get Source [Return] ${source} set appium timeout [Arguments] ${sec} set Appi Um Timeout ${sec} Set network connection state [Arguments] ${sec} set network Connection status ${sec} input value [Arguments] ${lo Cator} ${val} input Value ${locator} ${val} Enter password [Arguments] ${path} ${passwd} input Password ${ Path} ${passwd} input text [Arguments] ${path} ${text} input text ${path} ${text} return [documentation] Browse The device returns to the previous page go back reset app reset application lock screen [Arguments] ${sec} [Documentation] This method is only used for iOS lock ${se C} long press element [Arguments] ${locator} long press ${locator} length by keyword [Arguments] ${keycode} ${metastate}=None [documentation] KeyCode can be found in this URL: ... http:developer.android.com/reference/android/view/Keyevent.html ..... Args: ... \ \ \ \ \-KeyCode-The keycode to is sent to the device ... \ \-Metastate-Meta information about the KeyCode being sent Long press KeyCode ${keycode} ${metastate} Hide keyboard Hide Keyboar The D page should not contain elements [Arguments] ${locator} ${lvl}=INFO page should not contain Element ${locator} ${LVL} page should not contain text [Arguments] ${locator} ${lvl}=INFO page should not contain Text ${locator} ${LVL} page should contain element [Arguments] ${locator} ${lvl}=INFO page should contain Element ${locator} ${LVL} page should contain text [Arguments] ${locator} ${lvl}=INFO page should contain Text ${locator} ${lvl} page [Arguments] ${filename}=Capture Page screenshot ${filename}
Appiumlibrary User Keywords