Hey there! any question in your mind? Ask It Now!.

Popular Categories

How to get hidden value from a web page in selenium web-driver?

+2 votes
asked in Software Testing by pawan gill
i am trying to get a hidden value from webpage using Xpath but not working ,please tell me the solution .


1 Answer

+1 vote
answered by seleniumGuru Expert (4,570 points)

You can try java script executer like this

             JavascriptExecutor jse=(JavascriptExecutor)this.driver;

String script = "return document.getElementById('hidden_element_id_here').innerHTML";


commented by pawan gill (110 points)
Thanks Dear its working.
commented by nitin (810 points)
In some cases, one may find it useful to get the hidden text, which can be retrieved from element's textContent, innerText or innerHTML attribute, by calling element.attribute('attributeName') element.getAttribute("textContent") worked for me

Related Questions

+1 vote
1 answer 2,250 views
+5 votes
7 answers 14,605 views
+1 vote
1 answer 547 views
+2 votes
1 answer 135 views
0 votes
1 answer 180 views
+1 vote
1 answer 2,827 views
+2 votes
2 answers 822 views

Not a Member yet?

Ask to Folks Login

My Account
747 Folks are online
60 members and 687 guest online
Your feedback is highly appreciated