Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Source of the Page in Protractor

I am using Protractor to run my Test and want to capture the source of the Whole Page for debugging purpose. Using Selenium WebDriver

How do i get the Source of the Page (content similar to View/Source when manually viewing it)

like image 794
user3570910 Avatar asked May 20 '14 22:05

user3570910


1 Answers

I am not sure if you are looking for the source code of the page currently opened by driver, if Yes, you can use below method to get the source code.

System.out.println(driver.getPageSource());

hope it helps.

like image 184
Paras Avatar answered Oct 21 '22 08:10

Paras