RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

ClickOnwebElement not working #872

Open Rubhal opened 7 years ago

Rubhal commented 7 years ago

Hi, I am trying to click on a button inside web view. My test code is: public void testButtonClick() throws Exception{ WebView webView = (WebView) solo.getView(R.id.webView1); solo.waitForView(webView, 2000, false); By installButton=By.xpath("//button[@class=\"price buy id-track-click id-track-impression\"]");
solo.waitForWebElement(installButton, 60000, false);
solo.clickOnWebElement(installButton, 0, false);
}

I am loading the webpage with url: https://play.google.com/store/apps/details?id=com.whatsapp&hl=en

I have to click on the install button automatically. When i run this code i am getting webelement with xpath not found. please help me with this issue.

Thanks in advance!!