My Account

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

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

Thanks!

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";

jse.executeScript(script);

commented by pawan gill (110 points)
Thanks Dear its working.

Related Questions

+1 vote
1 answer 1,067 views