public void POMTestCase1() { log.Info("Test execution starts!"); // variable definitions (data-driven) string userName = Convert.ToString(this.TestContext.DataRow["userName"]); string passWord = Convert.ToString(this.TestContext.DataRow["passWord"]); string searchKeyWord = Convert.ToString(this.TestContext.DataRow["searchKeyWord"]); string firstName = Convert.ToString(this.TestContext.DataRow["firstName"]); string lastName = Convert.ToString(this.TestContext.DataRow["lastName"]); string emailAddress = Convert.ToString(this.TestContext.DataRow["emailAddress"]); string city = Convert.ToString(this.TestContext.DataRow["city"]); string address = Convert.ToString(this.TestContext.DataRow["address"]); string postalCode = Convert.ToString(this.TestContext.DataRow["postalCode"]); string cellPhoneNumber = Convert.ToString(this.TestContext.DataRow["cellPhoneNumber"]); string poNumber = Convert.ToString(this.TestContext.DataRow["poNumber"]); // navigate to the website HomePage homePage = new HomePage(driver); homePage.NavigateToHomePage(); // login LoginPage loginPage = homePage.GoToLoginPage(); loginPage.TypeUserName(userName); /* also has an assertion */ loginPage.TypePassword(passWord); /* also has an assertion */ loginPage.ConfirmLoginAndGoBackToHomePage(); // search for an item SearchResultPage searchResultPage = homePage.Search(searchKeyWord); // put the first searched item into cart searchResultPage.AddCertainItemToCart(0); // go to the shopping cart and accept the term of service ShoppingCartPage shoppingCartPage = searchResultPage.GoToShoppingCartPage(); shoppingCartPage.AcceptTermOfService(); shoppingCartPage.AssertSubTotalPrice(); /*confirm the subtotal output*/ // go to the checkout page and fill the info CheckoutPage checkoutPage = shoppingCartPage.GoToCheckoutPage(); checkoutPage.FillInfo(firstName, lastName, emailAddress, city, address, postalCode, cellPhoneNumber, poNumber); // go to thank you page ThankYouPage thankYouPage = checkoutPage.GoToThankYouPage(); // finish purchase and go back to home page HomePage homePageBack = thankYouPage.FinishPurchaseAndGoToHomePage(); // logout homePageBack.Logout(); log.Info("Test execution finishes!"); }