2

As per the documentation, there is in fact no class called WebElement when using Selenium with C#.NET, even though there exists an interface called IWebElement which has almost the same functionality. In contrast, when using Selenium with Java, for example, we have the WebElement class readily available.

What is the purpose of this change in implementation? Why have an interface over a separate class?

ChinthakaC
  • 47
  • 1
  • 7
  • 1
    `WebElement` in Java is also an interface https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html – Guy May 03 '17 at 12:55

1 Answers1

2

IWebElement is an interface that basically describes a contract which IWebElement implementations must follow. But, in Selenium, there is, for example, a RemoteWebElement class that implements the IWebElement interface.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195