Click
Description
This command will click an element. Although Appium provides a native click method, the SeeTest Client extends the click command by allowing you to specify how many clicks to perform. In addition, this command has the ability to click on elements based on OCR (optical character recognition).
Parameters
Name | Value | Description |
---|---|---|
zone | string | Zone - Native, Web, Text (OCR) |
elemen | string | xpath of the element to find. In case of Text (OCR), the element's text |
index | int | index of the element to find, if more than one element answers to the xpath query |
clickCount | int | Number of clicks to perform |
Usage
If your app includes a feature where an element or button need to be clicked more than once, you can use this command. You can also use this command to click on element that does not have a defined XPath and can only be recognized based text that appears in their image.
Example
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Usage of Click Command
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
...
...
// to click an native element in an app
seetest.click("NATIVE", "xpath=//*[@text='click me']", 0, 5);
// to click an element by OCR
seetest.click("TEXT", "click me", 0, 5);