Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- //referencja do przeglądarki
- IWebDriver driver = new ChromeDriver();
- static void Main(string[] args)
- {
- }
- [SetUp]
- public void Initialize()
- {
- //otwarcie strony google
- driver.Navigate().GoToUrl("https://www.google.com");
- }
- [Test]
- public void ExecuteTest()
- {
- //odszukanie elementu q
- IWebElement element = driver.FindElement(By.Name("q"));
- //wpisanie tekstu
- element.SendKeys("koronowirus");
- }
- [TearDown]
- public void CleanUp()
- {
- //zamknięcie przeglądarki
- driver.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement