Tuesday 8 July 2014

Click the Element inside the Span using selenium webdriver



1) If we want to work with any operation inside the span, its better to use xPath to identify the element.

2) if we want to click link by using below coding inside spane mean

<span> Mobiles & Accessories </span>

Then you should use the xPath to find the element, because those text is inside the span.

The below code is used to click the above web element in selenium webdriver

driver1.findElement(By.xPath("/html/body/div[4]/div[3]/div/div/div/div/ul/li[3]/span")).click();

No comments:

Post a Comment