Advertisement
kilya

Hello Worl in Selenium

Jan 26th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using OpenQA.Selenium;
  4. using OpenQA.Selenium.Chrome;
  5.  
  6. namespace Hello_World_Selenium
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             // Create the reference for our browser
  13.             IWebDriver driver = new ChromeDriver();
  14.             driver.Navigate().GoToUrl("http://www.google.com");
  15.             // Find the text input element by its name
  16.             IWebElement query = driver.FindElement(By.Name("q"));
  17.             // Enter something to search for       
  18.             query.SendKeys("Hello World");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement