@Ravi15, why don't you start a new topic as this question doesn't have much to do with this particular topic.
Myself, I use a method I've wrote called tapOn :
public static void tapOn(WebElement element){
new TouchAction((MobileDriver) getDriver()).tap(element).perform();
}
I just send him a WebElement. To get it, I use this :
getDriver().findElement(By.xpath(elementSelector))
where the elementSelector is the xPath, found with Appium finder for example.
It makes me able to first get the WebElement in the view, and then create the methods to tap on it.
I also experience a element cannot be tapped situation and using press is at least a step forward. Anyone knows if there's an upcoming fix?
What is getDriver() Method here.
I am using like this new TouchAction(((MobileDriver)driver).tap(arg0, arg1, arg2)), and here I am not getting tap() method which takes only one arguement, also perform() method is not coming.
Could you please explain your method in more detail.
Thanks
Yes for sure.
First I've the method getDriver :
public static WebDriver getDriver(){
return AppiumTest.driver;
}
It returns the driver, to make actions afterward.
Then each screen of the app is split in two sides : first I get the elements, then I create the methods (actions).
To get the elements, I use the method findElement i've wrote above.
And after, to tap on an element, I've created the method tapOn wrote above too. But getDriver() and tapOn() is wrote in another class accessible for each test.
You want an exemple ?
Hello,
I have a query regarding tap function. I wanted to test a touch action on the object that we have created on the canvas . I tried using tap and click but it didn't work me. And I am not able to see the object that I wanted to touch using ui automator. The object was a rectangle created by the 4 lines . Can someone suggest me how to perform touch on this object .
Thanks
Thanks .It is a native app.I will try chrome remote bugger .The main problem is with touching the object even though i have exact coordinates. I can actually see that it is performing touch by enabling show touches settings option in my tablet .Besides i am not able to see the window that has to be opened after touch is performed.

