1

I'm trying to automate one of my hybrid app using Appium. I'm getting an issue while clicking on the Login button. The error message I'm getting is:

org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (116, 329). Other element would receive the click: <button class="button button-medium button-custom-login " ng-click="login()">...</button>

And I just want to click on the same element i.e. the one mentioned here with attribute ng-click="login().

I've changed the context already to WebView and tried with changing the attribute to Native as well but nothing seems to be working.

The code which I've used to identify this element is below:

List<WebElement> labels = driver.findElementsByTagName("button");

I iterated through all the elements and found that I need to click on number 20 element.

Any help on this would be great. Thanks!

Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
Sunil Ojha
  • 223
  • 1
  • 7
  • 20

2 Answers2

2

You should try using Actions class as below :-

WebElement element = driver.findEle....
Actions action = new Actions(driver);
action.moveToElement(element).click().perform();
Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
0

If you have found that you need to click on number 20 element in the list, you could go this way:

int pos = 20;
List labels = driver.findElementsByTagName("button");
labels.get(pos-1).click();
Shahid
  • 2,288
  • 1
  • 14
  • 24
  • Tried this one already and this is also not working. Thanks for your suggestion though. – Sunil Ojha Sep 02 '16 at 10:57
  • does `driver.findElementsByTagName("button");` returns anything? – Shahid Sep 02 '16 at 10:58
  • Yes it does. It return around 25 elements. I retrieved the text of all the elements and found that number 20 is the Login button which I want to click and when I click on it using the .click method I get an error. It shows that "Other element would receive the click" and I need to click on this other element only which it is not doing. – Sunil Ojha Sep 02 '16 at 11:04
  • check this link then: http://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error – Shahid Sep 02 '16 at 11:19
  • Hey Shahid, The link which you have provided has worked. Below code worked for me: Actions actions = new Actions(driver); actions.moveToElement(e).click().perform(); – Sunil Ojha Sep 02 '16 at 11:55