public void ExecuteTest() { //Title SeleniumSetMethods.selectDropDown(driver, "TitleId", "Mr.", "Id"); SeleniumSetMethods.Entertext(driver, "Initial", "ExecuteAutomation", "Name"); Console.WriteLine("Value of Title is " + SeleniumGetMethods.GetTextFromDDL(driver, "TitleId", "Id")); Console.WriteLine("Value of Initial is " + SeleniumGetMethods.GetText(driver, "Initial", "Name")); SeleniumSetMethods.Click(driver, "Save", "Name"); }
public void FillUserForm(string initial, string middleName, string firstName) { SeleniumSetMethods.EnterText(txtInitial, initial); SeleniumSetMethods.EnterText(txtFirstName, firstName); SeleniumSetMethods.EnterText(txtMiddleName, middleName); SeleniumSetMethods.Click(btnSave); //txtInitial.SendKeys(initial); //txtFirstName.SendKeys(firstName); //txtMiddleName.SendKeys(middleName); //btnSave.Click(); }
public void ExecuteTest() { //Title SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id"); //Initial SeleniumSetMethods.EnterText(driver, "Initial", "executeautomation", "Name"); Thread.Sleep(1000); Console.WriteLine("The value from my Title is:" + SeleniumGetMethod.GetTextFromDDL(driver, "TitleId", "Id")); Console.WriteLine("The value from my Initial is:" + SeleniumGetMethod.GetText(driver, "Initial", "Name")); //Click SeleniumSetMethods.Click(driver, "Save", "Name"); }
public void ExecuteTest() { // Enter(element,value,type) <-- put elements in new class //Title SeleniumSetMethods.SelectDropDown("TitleId", "Mr.", PropertyType.Id); //Initial SeleniumSetMethods.EnterText("Initial", "executeA", PropertyType.Name); Console.WriteLine("The value from my Title is:" + SeleniumGetMethods.GetText("TitleId", PropertyType.Id)); Console.WriteLine("The value from my Initial is:" + SeleniumGetMethods.GetText("Initial", PropertyType.Name)); //Click Save SeleniumSetMethods.Click("Save", PropertyType.Name); Console.WriteLine(PropertiesCollection.driver.Title); //var title = driver.Title; Console.WriteLine("Executed Test"); }
public void ExecuteTest() { /* //EnterText(element, value, type); * * //Find the element * IWebElement element = driver.FindElement(By.Name("q")); * * //Perform Ops * element.SendKeys("Execute Automation"); * * Console.WriteLine("Executed Test"); */ //Title SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id"); //Initial SeleniumSetMethods.EnterText(driver, "Initial", "P.H.N.", "Id"); //Console.WriteLine("The value from my title is:" + SeleniumGetMethods.GetText(driver, "TitleId", "Id")); Console.WriteLine("The value from my initial is: " + SeleniumGetMethods.GetText(driver, "Initial", "Id")); //First Name //SeleniumSetMethods.EnterText(driver, "FirstName", "Prosonna", "name"); //Middle Name //SeleniumSetMethods.EnterText(driver, "MiddleName", "Hossain", "name"); //Gender //SeleniumSetMethods.Click(driver, "Male", "name"); //Languages Known //SeleniumSetMethods.Click(driver, "english", "name"); //Click SeleniumSetMethods.Click(driver, "Save", "name"); }
static void Main(string[] args) { string pathToDriver = "/Users/cliff/Desktop/SeleniumFirst/assets/"; // Create the reference for browser IWebDriver driver = new ChromeDriver(pathToDriver); Console.WriteLine("We are starting"); // Navigate to Test Site driver.Navigate().GoToUrl("http://www.executeautomation.com/demosite/index.html?UserName=&Password=&Login=Login"); Console.WriteLine("Browser Opened"); // Select Title SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id"); // Verify Selection Console.WriteLine("Title value is: " + SeleniumGetMethods.GetFromDropDown(driver, "TitleId", "Id")); // Enter Initial SeleniumSetMethods.EnterText(driver, "Initial", "JH", "Name"); // Verify Text Entered Console.WriteLine("Initial value is: " + SeleniumGetMethods.GetText(driver, "Initial", "Name")); // Enter First Name SeleniumSetMethods.EnterText(driver, "FirstName", "Jim", "Name"); // Verify Text Entered Console.WriteLine("FirstName value is: " + SeleniumGetMethods.GetText(driver, "FirstName", "Name")); // Enter Middle Name SeleniumSetMethods.EnterText(driver, "MiddleName", "Halpert", "Name"); // Verify Text Entered Console.WriteLine("MiddleName value is: " + SeleniumGetMethods.GetText(driver, "MiddleName", "Name")); // Click SeleniumSetMethods.Click(driver, "Save", "Name"); // Close Chrome driver.Close(); Console.WriteLine("Browser Closed"); }
public void OtherTest() { // Click SeleniumSetMethods.Click(driver, "Save", "Name"); Console.WriteLine("Executed test"); }