public void ThenOnlineSkillsShouldBeDisplayed() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.Extent.StartTest("Online Search"); Thread.Sleep(3000); string ExpectedValue = "Priyanka Singh"; string ActualValue = Driver.driver.FindElement(By.XPath("//a[contains(text(),'Priyanka Singh')]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Online Search selected"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Online Search selected"); Console.WriteLine("Online Search selected"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); Console.WriteLine("Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); Console.WriteLine("Test Failed due to exception", e.Message); } }
public void ThenThenTheModifiedDataShouldBeListedInSkillsDetails_() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("modify a skills Details"); IList <IWebElement> SearchResult1 = Driver.driver.FindElements(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody")); for (i = 1; i <= SearchResult1.Count; i++) { IWebElement SkillSearch = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")); // IWebElement ClickEdit = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[" + i + "]/tr/td[3]/span[1]/i")); if (SkillSearch.Text == "Java") { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, modified Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "modified"); Console.WriteLine("Success"); break; } } } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); Assert.Fail(ex.Message); } }
public void ThenThePasswordShouldBeChangedAsNewPasswordIHaveEntered() { IWebElement validateChanged = Driver.driver.FindElement(By.XPath("//div[@class='ns-box-inner'][contains(.,'Password Changed Successfully')]")); try { //Start the Reports Thread.Sleep(2000); CommonMethods.ExtentReports(); CommonMethods.test = CommonMethods.extent.StartTest("Change password"); wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@class='ns-box-inner'][contains(.,'Password Changed Successfully')]"))); string expectedMsg = "Password Changed Successfully"; string actualMsg = validateChanged.Text; Thread.Sleep(1000); if (expectedMsg == actualMsg) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added Skills Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillsAdded"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatSkillShouldGetDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Edit a Skill"); Thread.Sleep(1000); string ExpectedValue = "Time Management has been updated to your skills"; string ActualValue = Driver.driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Language was edited Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "LanguageEdited"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatCertificationShouldNotGetDisplayedInMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Cancel a Certification"); Thread.Sleep(1000); string ExpectedValue = "FakeCertification"; string ActualValue = Driver.driver.FindElement(By.XPath("//tbody/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedValue != ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Cancelled a Certification Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "CertificationCancelled"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatSameLanguageShouldBeDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Cancel an Editing of a Language"); Thread.Sleep(1000); string ExpectedValue = "English"; string ActualValue = Driver.driver.FindElement(By.XPath("//td[text()='English']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Cancelled an Editing of a Language Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Language Editing Cancelled"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed as it could not cancel the editing" + ActualValue); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThoseCertificationsAndShouldBeDisplayedOnMyListings(string certificaion, string from) { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add certifications"); Thread.Sleep(1000); for (int i = 1; i <= 100; i++) { string ExpectedName = certificaion; string ActualName = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedName == ActualName) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added certifications Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "certificationsAdded"); break; } else { } } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThoseSkillsShouldBeDisplayedOnMyListings(string skill) { int rowCount = Driver.driver.FindElements(By.CssSelector("#account-profile-section > div > section:nth-child(3) > div > div > div > div.eight.wide.column > form > div.ui.bottom.attached.tab.segment.tooltip-target.active > div > div.twelve.wide.column.scrollTable > div > table > thead > tr")).Count; try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add skills"); Thread.Sleep(1000); for (int i = 1; i <= rowCount; i++) { string ExpectedName = skill; string ActualName = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text; Thread.Sleep(1000); if (ExpectedName == ActualName) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added Skills Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillsAdded"); break; } else { } } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatCertificationShouldBeDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.Extent.StartTest("Add Certification"); Thread.Sleep(1000); string ExpectedValue = "istqb"; string ActualValue = Driver.driver.FindElement(By.XPath("//td[contains(text(),'istqb')]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added a Certificate Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Certificate Added"); Console.WriteLine("Certificate Added"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); Console.WriteLine("Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed due to exception", e.Message); Console.WriteLine("Test Failed due to exception", e.Message); } }
public void ThenTheDetailsOfMySharedSkillShouldBeDisplayed() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Found the details of Harris Jung"); Thread.Sleep(1000); string ExpectedValue = "Skills Trade"; string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='service-detail-section']/div[2]/div/div[2]/div[1]/div[1]/div[2]/div[2]/div/div/div[4]/div[2]/div/div/div[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Found the details of Harris Jung Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "ThedetailsFound"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatSkillsShouldBeDisplayedOnMyListing() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest(Name: "Add a skills"); Thread.Sleep(1000); string ExpectedValue = "Tester"; string ActualValue = Driver.driver.FindElement(By.XPath("//*div[@contains(text),'has been added']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added a Skills Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillsAdded"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatDeletedEducationShouldNotBeDisplayedOnMyListing() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Delete a Education"); Thread.Sleep(1000); string ExpectedValue = "Massey University"; string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Deleted a Education Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "EducationDelteted"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatEducationShouldNotGetDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Delete an Education"); Thread.Sleep(1000); string ExpectedValue = "Education entry successfully removed "; string ActualValue = Driver.driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Skill was deleted Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillDeleted"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenCheckNotMoreThanFourLanguagesAreAdded() { try { CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Adding maximum 4 languages"); Thread.Sleep(1000); IWebElement AddNewBtn = Driver.driver.FindElement(By.XPath("//thead//tr[1]//th[3]//div[contains(text(), 'Add New')@class='ui teal button ']")); if (AddNewBtn.Displayed) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } else { } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Maximum is four languages"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Maximum 4 Languages "); CommonMethods.test.Log(LogStatus.Pass, "Test Passed", e.Message); } }
public void ThenTheAddNewButtonShouldBeInvisible() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Maximum of 4 Languages only"); Thread.Sleep(1000); string xpathofAddnewbutton = "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/thead/tr/th[3]/div"; if (!ElementVisible(driver, "XPath", xpathofAddnewbutton)) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Add New button was invisible after adding maximum of 4 languages"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "No Add new Button after Maximum Languges are added"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed As the New button is still visible after maximum languages are added"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenTheDescriptionShouldBeDisplayed() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add Description"); Thread.Sleep(1000); string ExpectedValue = "I have 5 years of work experience working with TCS India.I worked in Oracle Financials and later moved into Recruitment."; string ActualValue = Driver.driver.FindElement(By.XPath("//span[contains(text(),'TCS')]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added Description Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "DescriptionAdded"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThereShouldBeAPopUpPleaseEnterLanguageAndLevel() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Language by missing a field"); Thread.Sleep(1000); string ExpectedValue = "Please enter language and level"; string ActualValue = Driver.driver.FindElement(By.XPath("/html/body/div[1]/div")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Have shown a message Please enter language and level"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Please enter language and level message displayed"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed Could not match with message" + ActualValue); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatDeletedLanguageShouldNotBeDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Delete a Language"); Thread.Sleep(1000); string ExpectedValue = "German"; string ActualValue = Driver.driver.FindElement(By.XPath("//*div[@contains(text),'has been Deleted']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Deleted a Languages Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "LanguageDeleted"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenIShouldAbleToGetAnErrorMessageThat(string p0) { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Update without edting any input"); Thread.Sleep(1000); string ExpectedValue = "This language is already added to your language list."; string ActualValue = Driver.driver.FindElement(By.XPath("/html/body/div[1]/div")).Text; Thread.Sleep(2000); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Have shown the message that language is already added"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Cannot Update to the same language"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed, as the language is added" + ActualValue); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
internal void viewtheskill() { Global.Base bases = new Global.Base(); Global.Base.ExtentReports(); Thread.Sleep(1000); Global.Base.test = Global.Base.extent.StartTest("Share skill Added"); int count = 0; count = Global.GlobalDefinitions.Driver.FindElements(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr")).Count; while (true) { for (var i = 1; i <= count; i++) { Thread.Sleep(1000); IWebElement Category = Driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[2]")); IWebElement Title = Driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[3]")); IWebElement Description = Global.GlobalDefinitions.Driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[4]")); if (Title.Text == GlobalDefinitions.ExcelLib.ReadData(2, "Title") && Description.Text == ExcelLib.ReadData(2, "Description")) { //test = extent.StartTest("Add a Share Skill"); // Global.Base.test.Log(LogStatus.Info, "Snapshot below: " + Global.Base.test.AddScreenCapture(SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.Driver, "Report"))); Global.Base.test.Log(LogStatus.Pass, "Test Passed, Share Skill Added successfully"); SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.Driver, "Share skill updated successfully"); Assert.AreEqual(Title.Text, GlobalDefinitions.ExcelLib.ReadData(2, "Title")); return; } } return; } }
public void ThenThatLanguageShouldBeDisplayedOnMyListings() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Language"); Thread.Sleep(1000); string ExpectedValue = "English"; string ActualValue = Driver.driver.FindElement(By.XPath("//tbody/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added a Language Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "LanguageAdded"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
internal void VerifyEditedEducation() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //verify updated education try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Updated Education"); //Jump to Education tab WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[3]", 10000); EducationBtn.Click(); //Verify Education Title WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[last()]/tr/td[3]", 10000); var lastRowEducationTitle = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[last()]/tr/td[3]")).Text; Assert.That(lastRowEducationTitle, Is.EqualTo(ExcelLibHelper.ReadData(3, "Title"))); CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Education Updated Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "EducationUpdated"); } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", ex.Message); } }
public void TearDown() { //Get test restult var status = TestContext.CurrentContext.Result.Outcome.Status; var stacktrace = "<pre>" + TestContext.CurrentContext.Result.StackTrace + "</pre>"; var errorMessage = TestContext.CurrentContext.Result.Message; // Screenshot String screenShotPath = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, TestContext.CurrentContext.Test.Name); // Write log to report LogStatus logstatus; switch (status) { case TestStatus.Failed: logstatus = LogStatus.Fail; test.Log(logstatus, "Test ended with " + logstatus + "–" + stacktrace + errorMessage); test.Log(LogStatus.Info, "Snapshot below:" + test.AddScreenCapture(screenShotPath)); break; case TestStatus.Passed: logstatus = LogStatus.Pass; test.Log(logstatus, "Test ended with " + logstatus); test.Log(LogStatus.Info, "Snapshot below:" + test.AddScreenCapture(screenShotPath)); break; } // end test. (Reports) extent.EndTest(test); // calling Flush writes everything to the log file (Reports) extent.Flush(); // Close the driver :) GlobalDefinitions.driver.Close(); GlobalDefinitions.driver.Quit(); }
internal void DeleteEducation() { // Refresh the page Driver.driver.Navigate().Refresh(); //Delete Education try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Delete Education"); //Click on education //Click on Education button WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[3]", 10000); EducationBtn.Click(); //Click on education to be deleted WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[last()]/tr/td[1]", 10000); EduToSel.Click(); //Click on delete education button WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[last()]/tr/td[6]/span[2]/i", 20000); DeleteEduBtn.Click(); CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Education Deleted Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "EducationDeleted"); } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", ex.Message); } }
public void ThenThatSkillsShouldBeDisplayedOnMyListings() { Assert.IsTrue(Driver.driver.FindElement(By.XPath("//td[text()='Automation Testing']")).Displayed); try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Skill"); Thread.Sleep(1000); string ExpectedValue = "Automation Testing"; string ActualValue = Driver.driver.FindElement(By.XPath("//td[text()='Automation Testing']")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added skill Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillAdded"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public static void EditValidation() { try { //Start the Reports CommonMethods.ExtentReports(); Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); CommonMethods.test = CommonMethods.extent.StartTest("Edit a Language"); Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); string ExpectedValue = "British English"; string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody/tr/td[1]")).Text; Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Edited a Language Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "LanguageEdited"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenItShouldBeDisplayedUnderCertificationOnMyProfile() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Certification"); Thread.Sleep(1000); string ExpectedValue = "ISTQB"; string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added a Certification Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Certification Added"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenIShouldAbleToGetAnInformationMessage(string p0) { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Add a Duplicate data"); Thread.Sleep(1000); string ExpectedValue = "Duplicated data"; string ActualValue = Driver.driver.FindElement(By.XPath("/html/body/div[1]/div")).Text; Thread.Sleep(2000); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Have shown the message that its a Duplicate data"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Duplicated data"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failed, as the language is Duplicated" + ActualValue); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenTheCertificationDetailsShouldBeDeleted() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Delete a Certification"); int tempValue = 0; Thread.Sleep(1000); //Find the no of Table body IReadOnlyCollection <IWebElement> NoOfRows = Driver.driver.FindElements(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody")); for (int i = 1; i <= NoOfRows.Count; i++) { tempValue = 1; string ExpectedValue = CommonMethods.ExcelLib.ReadData(2, "DeleteCertification"); string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); return; } } if ((NoOfRows.Count) == 0 || tempValue == 1) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Deleted Certification Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "CertificationDeleted"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void ThenThatSkillsShouldBeDisplayed() { try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.Extent.StartTest("Category and subcategory"); Thread.Sleep(1000); string ExpectedValue = "satheesh gollapudi"; string ActualValue = Driver.driver.FindElement(By.XPath("//div[@class='ui stackable three cards']/div[4]/div[1]/a[1]")).Text; Thread.Sleep(500); if (ExpectedValue == ActualValue) { CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Category and subcategory selected"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "Category and subcategory selected"); Console.WriteLine("Category and subcategory selected"); } else { CommonMethods.test.Log(LogStatus.Fail, "Test Failede.Message"); Console.WriteLine("Test Failed due to exception,e.Message"); } } catch (Exception e) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", e.Message); Console.WriteLine("Test Failed due to exception", e.Message); } }