Junior — Middle
Have you had practical experience using WebDriver for test automation or web page interaction?
sobes.tech AI
Answer from AI
Yes, WebDriver is widely used for automating the testing of web applications. It allows programmatic control of the browser, emulating user actions (clicks, text input, navigation), and checking the page's state.
Example in C# using Selenium WebDriver:
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
var driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://example.com");
var element = driver.FindElement(By.Id("login"));
element.SendKeys("username");
var button = driver.FindElement(By.CssSelector("button.submit"));
button.Click();
driver.Quit();
This approach allows creating automated tests that verify the website's functionality, as well as using WebDriver for parsing or interacting with web pages outside of testing.