Skip to content

Commit

Permalink
Updating .NET getPageSource implementation to match W3C spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jan 19, 2016
1 parent 4e7489e commit bc5ad70
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions dotnet/src/webdriver/Remote/RemoteWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,8 @@ public string PageSource
get
{
string pageSource = string.Empty;
if (this.IsSpecificationCompliant)
{
string script = "var source = document.documentElement.outerHTML; \n"
+ "if (!source) { source = new XMLSerializer().serializeToString(document); }\n"
+ "return source;";
pageSource = this.ExecuteScript(script).ToString();
}
else
{
Response commandResponse = this.Execute(DriverCommand.GetPageSource, null);
pageSource = commandResponse.Value.ToString();
}

Response commandResponse = this.Execute(DriverCommand.GetPageSource, null);
pageSource = commandResponse.Value.ToString();
return pageSource;
}
}
Expand Down

0 comments on commit bc5ad70

Please sign in to comment.