How to check if the text is high lighted on the webpage...?

36 views
Skip to first unread message

javel...@gmail.com

unread,
May 5, 2018, 10:11:43 AM5/5/18
to Selenium Users
Hello selenium user, 

Can anyone please share how to check whether the text is highlighted on Webpage or not..? 

I have found the following script... Can anyone please share how it works? Thanks! 

((JavascriptExecutor)driver).executeScript("return window.getSelection().toString();");


Mahmoud Abuzaid

unread,
May 6, 2018, 6:22:45 AM5/6/18
to Selenium Users
Try to check the xpath with style if it returns true or false

Java Learner

unread,
May 6, 2018, 12:06:32 PM5/6/18
to seleniu...@googlegroups.com
Thanks for replying can you please elaborate it I didn't get it... Thanks

On Sat, May 5, 2018 at 11:37 AM, Mahmoud Abuzaid <eng.ma...@gmail.com> wrote:
Try to check the xpath with style if it returns true or false

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/hHfkEH0lZiI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/14d8c207-4791-434b-a4b1-74fa2c726bc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mahmoud Abuzaid

unread,
May 9, 2018, 9:07:27 AM5/9/18
to Selenium Users
I need to see your html to help you please quote it here

for example:

//div[@class='foo'][@style='']

On Sunday, May 6, 2018 at 6:06:32 PM UTC+2, Java Learner wrote:
Thanks for replying can you please elaborate it I didn't get it... Thanks
On Sat, May 5, 2018 at 11:37 AM, Mahmoud Abuzaid <eng.ma...@gmail.com> wrote:
Try to check the xpath with style if it returns true or false

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/hHfkEH0lZiI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

javel...@gmail.com

unread,
May 9, 2018, 2:23:13 PM5/9/18
to Selenium Users
thanks a lot Mahmoud!! 
Reply all
Reply to author
Forward
0 new messages