From bc5ad706d3be6343a97545eb94e779912fa214d7 Mon Sep 17 00:00:00 2001 From: Jim Evans Date: Tue, 19 Jan 2016 13:35:18 -0800 Subject: [PATCH] Updating .NET getPageSource implementation to match W3C spec --- dotnet/src/webdriver/Remote/RemoteWebDriver.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs index 6f14bb1015fef..0698bbd2fcf04 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs @@ -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; } }