Skip to main content

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

NameValueDescription
zonestringZone - Native, Web, Text (OCR)
elemenstringxpath of the element to find. In case of Text (OCR), the element's text
indexintindex of the element to find, if more than one element answers to the xpath query
clickCountintNumber 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.

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);