I am trying to click on cart icon on top right corner from Appium in chrome browser mobile.
Code to click :
driver.findElement(By.xpath("//a[@href='/viewcart']")).click();
URL : https://www.2gud.com/?cmpid=2G108229
Note: Please open this URL in mobile device and verify.
Error : Code is clicking somewhere else on mobile device.
Thank you in Advance.
Sorry, but i dont see the cart icon in this siteā¦ the URL is correct?
@Sagar_Khalasi there are 2 carts:
first when open page:
<a href="/rv/viewcart" class="_3NH1qf"><img src="..."></a>
second when scroll down -> header will be updated and cart will change to:
<a href="/viewcart" class="_1iILZ2"><div><img src="..."></div></a>
so did you scroll down before trying to you click?