1

I am using Visual Studio 2017 and found that class ChromeDriver does not contains method getPageSource(). Does anybody knows why?

using System;
using System.IO;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;

Error CS1061 "ChromeDriver" no contiene una definición para "getPageSource" ni se encuentra ningún método de extensión "getPageSource" accesible que acepte un primer argumento del tipo "ChromeDriver" (¿falta alguna directiva using o una referencia de ensamblado?) SeleniumTest C:\tfs\CHI-VT-DEV\04-Programación\VisualTIME\Test\Functional\SeleniumTest\InMotionGIT.Test.Selenium.cs 29 Activo

2
  • Please edit your question to add the code where you are calling getPageSource
    – Kate Paulk
    Jan 25, 2019 at 19:27
  • Additionally, could you update the error message to English? Jan 25, 2019 at 20:11

2 Answers 2

1

In C# (VS) you should to use:

string html = this.driver.PageSource;

instead of

driver.getPageSource();
1

The getPageSource method, in C#, is actually a property:

string html = this.driver.PageSource;

See PageSource documentation for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.