I'm working on mobile automation on iOS platform using the following:
Selenium WebDriver: 2.47
Appium dot net driver: 1.4.0.3
Appium: 1.4.8
I want find a element using xpath and click on it. But I don't want to use the native methods of Selenium webdriver.
I want to perform this operation using javascript.
I have tried the following:
1
_driver.ExecuteScript("window.document.evaluate(\"//a[contains(text(),'Log In')]\", document.lastChild, null,XPathResult.ANY_TYPE, null).click()");
2
IList<IWebElement> buttons = _driver.FindElements(By.XPath("//a[contains(text(),'Log In')]"));
_driver.ExecuteScript("arguments[0].click();", buttons[0]);
3
_driver.FindElement(By.XPath("//a[contains(text(),'Log In')]")).Click();
I'm able to switch to webviews but unable to click on this particular elment. In the second method, I can see that I can fetch the element but calling click() method is not clicking the element.
Thanks in advance. I'm stuck here for two days now.
update:
Here is the html of the button I want to click on:
<a class="btn btn-outline white slide-demo" data-slide-target=".slide-wrap">Log In</a>