How to get Hello text

24 views
Skip to first unread message

Ankit Singh

unread,
May 30, 2017, 9:29:20 AM5/30/17
to Selenium Users
Hello All,

Need your help to find-out CSS selection for Hello. Following are HTML. I want to get hello text

<span class="label">
<label for="bundle-option-597722-1032930">Hello</label>
</span>


Thank you in advance 
--
-------------------------------
Cordially --


Ankit Singh
Mobile: +91-8447506507          

Shawn McCarthy

unread,
May 30, 2017, 12:43:30 PM5/30/17
to Selenium Users
label[for="bundle-option-597722-1032930"]

Monika Singhal

unread,
Jun 2, 2017, 2:16:03 AM6/2/17
to Selenium Users
Hi,

If you want to get hello text. You can follow the code I have specified below:

driver.findElement(By.xpath("span[@class='label']/label")).getText();

Thanks & Regards,
Monika
Reply all
Reply to author
Forward
0 new messages