public void BuyInspirationRoom() { WriteTestResultsExcel.setTestCaseStart("Customer Journey Buy Inspirational Room", "Customer Journey Buy Inspirational Room"); try { //Test Step 1 { WriteTestResultsExcel.setTestStepStart("Click on Inspiration in navbar on startpage", "Click on Inspiration in navbar on startpage"); String inspirationLinkLink = getDictionaryValue(Desenio_Test_Objects.INSPIRATION_LINK, "xpath"); operateOnWebDriverElement.ClickAnElementByXPath(inspirationLinkLink); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 2 { WriteTestResultsExcel.setTestStepStart("Click on the first inspiration room", "Click on the first inspiration room"); String roomLinkXpath = getDictionaryValue(Desenio_Test_Objects.ROOM_LINK, "xpath"); operateOnWebDriverElement.ClickAnElementByXPath(roomLinkXpath); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 3 { WriteTestResultsExcel.setTestStepStart("Click on the Buy Container button", "Click on the Buy Container button"); String buyArticleButtonXpath = getDictionaryValue(Desenio_Test_Objects.BUY_BUTTON, "xpath"); operateOnWebDriverElement.ClickAnElementByXPath(buyArticleButtonXpath); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 4 { WriteTestResultsExcel.setTestStepStart("Click on the Close window button", "Click on the Close window button"); String closeWindoeButtonXpath = getDictionaryValue(Desenio_Test_Objects.CLOSE_BUTTON, "id"); operateOnWebDriverElement.ClickAnElementById(closeWindoeButtonXpath); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 5 { WriteTestResultsExcel.setTestStepStart("Till Kassan", "Till Kassan"); String kassanButtonId = getDictionaryValue(Desenio_Test_Objects.KASSAN_BUTTON, "id"); //operateOnWebDriverElement.ClickAnElementByClassName(checkOutButtonClass); operateOnWebDriverElement.ClickAnElementById(kassanButtonId); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 6 { WriteTestResultsExcel.setTestStepStart("Verify the Kassan page", "Verify the Kassan page"); String checkOutButtonXpath = getDictionaryValue(Desenio_Test_Objects.CHECKOUT_TEXT, "xpath"); //operateOnWebDriverElement.ClickAnElementByClassName(checkOutButtonClass); String titleText = operateOnWebDriverElement.GetTextOnElementByXPath(checkOutButtonXpath); Console.WriteLine(titleText); WriteTestResultsExcel.setTestStepFinish("Pass", null); } // Finish Test Case WriteTestResultsExcel.setTestCaseFinish("Pass"); } catch (Exception e) { WriteTestResultsExcel.setTestStepFinish("Fail", e); WriteTestResultsExcel.setTestCaseFinish("Fail"); throw e; } }
public void Setup() { SeleniumSetup(); WriteTestResultsExcel.setTestClassStart("Customer Journey Buy Inspiration Room", dateTime); }
public void tearDown() { SeleniumQuit(); WriteTestResultsExcel.setTestClassFinish("Customer Journey Buy Inspiration Room"); }
public void tearDown() { SeleniumQuit(); WriteTestResultsExcel.setTestClassFinish("Test the Demo site testingpool"); }
public void TC1_RegisterDetails() { WriteTestResultsExcel.setTestCaseStart("Register the details", "Register the details"); try { //Test step 1 { WriteTestResultsExcel.setTestStepStart("Enter the First and Last Name", "Enter the First and Last Name"); String firstNameId = getDictionaryValue(Test_Objects.FIRST_NAME, "id"); String lastNameId = getDictionaryValue(Test_Objects.LAST_NAME, "id"); operateOnWebDriverElement.InsertInToFieldById(firstNameId, TestData.firstName); operateOnWebDriverElement.InsertInToFieldById(lastNameId, TestData.lastName); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 2 { WriteTestResultsExcel.setTestStepStart("Select the Gender", "Select the Gender"); String genderId = getDictionaryValue(Test_Objects.GENDER_RADIO, "id"); operateOnWebDriverElement.ClickAnElementById(genderId); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 3 { WriteTestResultsExcel.setTestStepStart("Select the Day", "Select the Day from the list"); String weekdayName = getDictionaryValue(Test_Objects.SELECT_DAY, "name"); incaFunction.clickButtonUsingNameAndOption(weekdayName, TestData.weekDay); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 4 { WriteTestResultsExcel.setTestStepStart("Select the option from Drop Down", "Select the option from Drop Down"); String dropDownName = getDictionaryValue(Test_Objects.SELECT_FROM_DROPDOWN, "name"); incaFunction.clickButtonUsingNameAndOption(dropDownName, TestData.number); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 5 { WriteTestResultsExcel.setTestStepStart("Click the Submit button", "Click the Submit button"); String submitBtn = getDictionaryValue(Test_Objects.SUBMIT_BUTTON, "id"); operateOnWebDriverElement.ClickAnElementById(submitBtn); WriteTestResultsExcel.setTestStepFinish("Pass", null); } // Test step 6 { WriteTestResultsExcel.setTestStepStart("Click Ok on the pop up window", "Click Ok on the pop up window"); IAlert submitAlert = driver.SwitchTo().Alert(); submitAlert.Accept(); WriteTestResultsExcel.setTestStepFinish("Pass", null); } // Test step 7 { WriteTestResultsExcel.setTestStepStart("Click the link on the page", "Click the link on the page and navigate to new window"); driver.FindElementByLinkText("Learn Selenium!!").Click(); driver = FindWebDriverElement.SwitchWindowByTitle(driver, "Selenium IDE part 1 - Testingpool"); String title = driver.Title; WriteTestResultsExcel.setTestStepFinish("Pass", null); } } catch (Exception e) { WriteTestResultsExcel.setTestStepFinish("Fail", e); WriteTestResultsExcel.setTestCaseFinish("Fail"); throw e; } }
public void Setup() { SeleniumSetup(); WriteTestResultsExcel.setTestClassStart("Test the Demo site of testingpool", dateTime); }
public void TC2_AddToCart() { WriteTestResultsExcel.setTestCaseStart("Add the item to cart", "Add the item to cart"); try { //Test step 1 { WriteTestResultsExcel.setTestStepStart("Click the T-Shirt section", "Click the T-Shirt section"); String productLink = getDictionaryValue(Test_Objects.PRODUCT_LINK, "link"); IWebElement webelement = findWebDriverElement.waitForElementByLinkText(null, null, productLink); webelement.Click(); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 2 { WriteTestResultsExcel.setTestStepStart("Click on Faded Short Sleeve T-shirt", "Click on Faded Short Sleeve T-shirt"); String productName = getDictionaryValue(Test_Objects.PRODUCT_NAME, "link"); IWebElement webelement = findWebDriverElement.waitForElementByLinkText(null, null, productName); webelement.Click(); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 3 { WriteTestResultsExcel.setTestStepStart("Click on Add to Cart", "Click on Add to Cart"); String addToCart = getDictionaryValue(Test_Objects.ADDTOCART_BUTTON, "id"); operateOnWebDriverElement.ClickAnElementById(addToCart); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 4 { WriteTestResultsExcel.setTestStepStart("Click on Proceed to Checkout", "Click on Proceed to Checkout"); String checkoutLink = getDictionaryValue(Test_Objects.PROCEEDTOCHECKOUT_BUTTON, "link"); IWebElement webelement = findWebDriverElement.waitForElementByLinkText(null, null, checkoutLink); webelement.Click(); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test step 5 { WriteTestResultsExcel.setTestStepStart("Click on Proceed to Checkout", "Click on Proceed to Checkout"); String checkoutLink = getDictionaryValue(Test_Objects.PROCEEDTOCHECKOUT_BUTTON, "link"); IWebElement webelement = findWebDriverElement.waitForElementByLinkText(null, null, checkoutLink); webelement.Click(); WriteTestResultsExcel.setTestStepFinish("Pass", null); } } catch (Exception e) { WriteTestResultsExcel.setTestStepFinish("Fail", e); WriteTestResultsExcel.setTestCaseFinish("Fail"); throw e; } }
public void tearDown() { SeleniumQuit(); WriteTestResultsExcel.setTestClassFinish("Test the Demo site automationpractice"); }
public void Setup() { SeleniumSetup(); WriteTestResultsExcel.setTestClassStart("Test the Demo site automationpractice", dateTime); }
public void CustomerJourney() { WriteTestResultsExcel.setTestCaseStart("Customer Journey", "Customer Journey"); try { //Test Step 1 { WriteTestResultsExcel.setTestStepStart("Click on Nyheter in navbar on startpage", "Click on Nyheter in navbar on startpage"); String nyheterLinkXpath = getDictionaryValue(Desenio_Test_Objects.NYHETER_LINK, "xpath"); operateOnWebDriverElement.ClickAnElementByXPath(nyheterLinkXpath); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 2 { WriteTestResultsExcel.setTestStepStart("Click on the first article", "Click on the first article"); String articleLinkId = getDictionaryValue(Desenio_Test_Objects.ARTICLE_LINK, "id"); String articleLinkText = getDictionaryValue(Desenio_Test_Objects.ARTICLE_LINK, "text"); // operateOnWebDriverElement.ClickAnElementByLinkText(articleLinkText); // driver.FindElement(By.PartialLinkText("Poppy")).Click(); clickLinkText(articleLinkId, articleLinkText); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 3 { WriteTestResultsExcel.setTestStepStart("Add the article to shopping bag", "Add the article to shopping bag"); String addArticleButtonId = getDictionaryValue(Desenio_Test_Objects.ADDITEM_BUTTON, "id"); String addArticleButtonText = getDictionaryValue(Desenio_Test_Objects.ADDITEM_BUTTON, "text"); clickTableLink(addArticleButtonId, addArticleButtonText); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 4 { WriteTestResultsExcel.setTestStepStart("Till Kassan", "Till Kassan"); String checkOutButtonClass = getDictionaryValue(Desenio_Test_Objects.CHECKOUT_BUTTON, "xpath"); //operateOnWebDriverElement.ClickAnElementByClassName(checkOutButtonClass); operateOnWebDriverElement.ClickAnElementByXPath(checkOutButtonClass); WriteTestResultsExcel.setTestStepFinish("Pass", null); } //Test Step 5 { WriteTestResultsExcel.setTestStepStart("Verify the Kassan page", "Verify the Kassan page"); String checkOutButtonXpath = getDictionaryValue(Desenio_Test_Objects.CHECKOUT_TEXT, "xpath"); //operateOnWebDriverElement.ClickAnElementByClassName(checkOutButtonClass); String titleText = operateOnWebDriverElement.GetTextOnElementByXPath(checkOutButtonXpath); Console.WriteLine(titleText); WriteTestResultsExcel.setTestStepFinish("Pass", null); } // Finish Test Case WriteTestResultsExcel.setTestCaseFinish("Pass"); } catch (Exception e) { WriteTestResultsExcel.setTestStepFinish("Fail", e); WriteTestResultsExcel.setTestCaseFinish("Fail"); throw e; } }