internal void UpdateEducation() { Driver.TurnOnWait(); Educationtab.Click(); Driver.TurnOnWait(); { for (int j = 1; j <= 5; j++) { var all = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/table/tbody[" + j + "]/tr/td[2]")); Console.WriteLine(all.Text); ExcelLibHelper.PopulateInCollection(@"C:\Advance task\MarsQA-1\SpecflowTests\Data\Mars.xlsx", "language"); if (all.Text == (ExcelLibHelper.ReadData(2, "education"))) { IWebElement editEducation = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/table/tbody[" + j + "]/tr/td[6]/span[1]")); editEducation.Click(); Console.WriteLine("Record ready to update"); IWebElement UpdateEducation = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div/input[1]")); UpdateEducation.Clear(); UpdateEducation.SendKeys(ExcelLibHelper.ReadData(2, "edUpdate")); Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div[3]/input[1]")).Click(); return; } } } }
public static void EditCertification() { ExcelLibHelper.PopulateInCollection(@"C:\AdvancedTaskLevel1\onboarding.specflow-master\MarsQA-1\SpecflowTests\Data\ProfileData.xlsx", "Cerification"); Driver.TurnOnWait(); EditCertificateIconlastRow.Click(); Thread.Sleep(1000); CertificatevalueEdit.Clear(); CertificatevalueEdit.SendKeys(ExcelLibHelper.ReadData(3, "Certificate")); CertificateFromEdit.Clear(); CertificateFromEdit.SendKeys(ExcelLibHelper.ReadData(3, "From")); SelectElement year = new SelectElement(CertificateYearEdit); year.SelectByText(ExcelLibHelper.ReadData(3, "Year")); UpdateCertificateButtonlastRow.Click(); Thread.Sleep(1000); }
public static void AddEducation() { ExcelLibHelper.PopulateInCollection(@"C:\AdvancedTaskLevel1\onboarding.specflow-master\MarsQA-1\SpecflowTests\Data\ProfileData.xlsx", "Education"); //Click on Add new button for education Driver.TurnOnWait(); EducationAddNew.Click(); //Enter Valid Education details Driver.TurnOnWait(); CollegeName.SendKeys(ExcelLibHelper.ReadData(2, "CollegeName")); SelectElement country = new SelectElement(CountryDropdown); country.SelectByText(ExcelLibHelper.ReadData(2, "CountryOfCollege")); SelectElement Titledrop = new SelectElement(TitleDropdown); Titledrop.SelectByText(ExcelLibHelper.ReadData(2, "TitleDrop")); Degree.SendKeys(ExcelLibHelper.ReadData(2, "Degree")); SelectElement Yeardrop = new SelectElement(GradutionYearDropDown); Yeardrop.SelectByText(ExcelLibHelper.ReadData(2, "Year")); AddButtonEducationData.Click(); }
internal void EditCertification() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //Click on certification //Click on Certifications WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[4]", 10000); CertificationBtn.Click(); //Click on certification to be edit WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[last()]/tr/td[1]", 10000); CertiToSel.Click(); //Click on edit certification button WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[last()]/tr/td[4]/span[1]/i", 10000); EditCertiBtn.Click(); //Update certification WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "certificationYear", 10000); CertiYear.Click(); new SelectElement(CertiYear).SelectByText(ExcelLibHelper.ReadData(3, "YearOfCertification"));; Thread.Sleep(1000); }
internal void EnterCertification() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //Click on Certifications WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[4]", 10000); CertificationBtn.Click(); //Click on add new certifications WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/thead/tr/th[4]/div", 10000); AddNewCertiBtn.Click(); //Input Certification WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "certificationName", 10000); CertifiBtn.Click(); CertifiName.SendKeys(ExcelLibHelper.ReadData(2, "Certificate")); //Input certification from WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "certificationFrom", 10000); CertiFromBtn.Click(); CertifiFrom.SendKeys(ExcelLibHelper.ReadData(2, "CertifiedFrom")); //Select year from drop down WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "certificationYear", 10000); CertiYear.Click(); new SelectElement(CertiYear).SelectByText(ExcelLibHelper.ReadData(2, "YearOfCertification"));; Thread.Sleep(1000); }
public void ThenShouldBeAbleToVerifyTheEditedSkill() { ExcelLibHelper.PopulateInCollection(ConstantHelpers.DataFilePath, "Skill"); SkillPage skillPage = new SkillPage(); skillPage.EditSkill(ExcelLibHelper.ReadData(2, "Skill"), ExcelLibHelper.ReadData(3, "Skill")); }
public static void Langedit() { ExcelLibHelper.PopulateInCollection(@"D:\Mars\AdvancedTaskTeam-master\onboarding.specflow-master\MarsQA-1\SpecflowTests\Data\ProfileData.xlsx", "Language"); Driver.TurnOnWait(); Editlanguage.Click(); }
public static void UpdateLanguage() { { for (int j = 1; j <= 5; j++) { var all = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td[1]")); Console.WriteLine(all.Text); ExcelLibHelper.PopulateInCollection(@"C:\Advance task\MarsQA-1\SpecflowTests\Data\Mars.xlsx", "language"); if (all.Text == (ExcelLibHelper.ReadData(2, "language"))) { IWebElement editLanguage = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td[3]/span[1]")); editLanguage.Click(); Console.WriteLine("Record ready to update"); IWebElement languageedit = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div/input[1]")); languageedit.Clear(); languageedit.SendKeys(ExcelLibHelper.ReadData(2, "langupdate")); SelectElement s = new SelectElement(Driver.driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div[2]/select"))); s.SelectByText("Basic"); Driver.driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/span/input[1]")).Click(); return; } } } }
internal void VerifySkill() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "ShareSkill"); //Verify share skill details WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id=\"listing-management-section\"]/div[2]/div[1]/div[2]/button[2]", 10000); ManageLis.Click(); Driver.driver.Navigate().Refresh(); try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Verify ShareSkill"); WaitHelpers.WaitForElement(Driver.driver, "XPath", "//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[2]", 10000); var categorycheck = Driver.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[2]")).GetAttribute("textContent"); Assert.That(categorycheck, Is.EqualTo(ExcelLibHelper.ReadData(2, "Category"))); WaitHelpers.WaitForElement(Driver.driver, "XPath", "//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[3]", 10000); var titlecheck = Driver.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[3]")).GetAttribute("textContent"); Assert.That(titlecheck, Is.EqualTo(ExcelLibHelper.ReadData(2, "Title"))); CommonMethods.test.Log(LogStatus.Pass, "Test Passed, ShareSkill Verified Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "ShareSkillVerified"); } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", ex.Message); } }
internal void DeleteManageListing() { ManageListingtab.Click(); Driver.TurnOnWait(); for (int i = 1; i <= 10; i++) { var titletext = Driver.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[ " + i + "]/td[3]")); //Console.WriteLine(all.Text); ExcelLibHelper.PopulateInCollection(@"C:\Advance task\MarsQA-1\SpecflowTests\Data\\Mars.xlsx", "ManageListing"); if (titletext.Text == (ExcelLibHelper.ReadData(2, "Title"))) //(GlobalDefinitions.ExcelLib.ReadData(2, "Title"))) { IWebElement deleteSkill = Driver.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[3]")); deleteSkill.Click(); //Select no from the two options //IWebElement noOption = GlobalDefinitions.driver.FindElement(By.CssSelector("button.ui.negative.button")); //noOption.Click(); //Select yes from the two options IWebElement yesOption = Driver.driver.FindElement(By.CssSelector("button.ui.icon.positive.right.labeled.button")); yesOption.Click(); Console.WriteLine("Record deleted"); return; } } }
public static void AddEducation() { //Click on Education Tab Educationtab.Click(); //Click on Add new button AddNewEducationbtn.Click(); ExcelLibHelper.PopulateInCollection(@"C:\Advance task\MarsQA-1\SpecflowTests\Data\Mars.xlsx", "language"); //Enter College/university name CollegeName.SendKeys(ExcelLibHelper.ReadData(2, "education")); //Select Country from the dropdown SelectElement education = new SelectElement(Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/div/div/div[2]/select"))); education.SelectByText("Australia"); //Select title from the dropdown SelectElement title = new SelectElement(Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/div/div[2]/div/select"))); title.SelectByIndex(2); //Enter degree degree.SendKeys("Engg3"); //Select year of Graduation from the dropdown SelectElement yearofGraduation = new SelectElement(Driver.driver.FindElement(By.XPath("//div[@data-tab = 'third']/div/div[2]/div/div/div[2]/div[3]/select"))); yearofGraduation.SelectByText("2017"); //Click on Add button AddEducationbtn.Click(); }
internal void EditEducation() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //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 edit 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 edit 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[1]/i", 10000); EditEduBtn.Click(); //Update education WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "title", 10000); SelectTitle.Click(); new SelectElement(SelectTitle).SelectByText(ExcelLibHelper.ReadData(3, "Title")); Thread.Sleep(1000); }
public void Setup() { //launch the browser Initialize(); ExcelLibHelper.PopulateInCollection(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\SpecflowTests\Data\Mars.xlsx", "Credentials"); ExtentReports(); }
internal void updateSkill() { Driver.TurnOnWait(); skillstab.Click(); Driver.TurnOnWait(); { for (int j = 1; j <= 5; j++) { var all = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + j + "]/tr/td[1]")); Console.WriteLine(all.Text); ExcelLibHelper.PopulateInCollection(@"C:\Advance task\MarsQA-1\SpecflowTests\Data\Mars.xlsx", "language"); if (all.Text == (ExcelLibHelper.ReadData(2, "skill"))) { IWebElement editSkill = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + j + "]/tr/td[3]/span[1]")); editSkill.Click(); Console.WriteLine("Record ready to update"); IWebElement Skilledit = Driver.driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div/input[1]")); Skilledit.Clear(); Skilledit.SendKeys(ExcelLibHelper.ReadData(2, "SkillUpdate")); SelectElement s = new SelectElement(Driver.driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div[2]/select"))); s.SelectByText("Intermediate"); Driver.driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/span/input[1]")).Click(); return; } } } }
internal void ValidateEditedDetails() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "ManageListing"); // Refresh the page Driver.driver.Navigate().Refresh(); //Validate edited data //Click on Manage Listing WaitHelpers.WaitForElementVisibility(Driver.driver, "LinkText", "Manage Listings", 10000); manageListingsLink.Click(); Thread.Sleep(5000); //Click on view button WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "(//i[@class='eye icon'])[1]", 10000); view.Click(); Driver.driver.Navigate().Refresh(); try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("EditListing"); WaitHelpers.WaitForElement(Driver.driver, "XPath", "//*[@id='service-detail-section']/div[2]/div/div[2]/div[1]/div[1]/div[2]/h1/span", 20000); var ViewValidation = Driver.driver.FindElement(By.XPath("//*[@id='service-detail-section']/div[2]/div/div[2]/div[1]/div[1]/div[2]/h1/span")).Text; Assert.That(ViewValidation, Is.EqualTo(ExcelLibHelper.ReadData(3, "Title"))); CommonMethods.test.Log(LogStatus.Pass, "Listing Edited successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "ListingUpdated"); } catch (Exception ex) { Assert.Fail("verify the edited share skill page failed", ex.Message); CommonMethods.test.Log(LogStatus.Fail, "Unable to edit listing"); } }
internal void EditSkills() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //Click on skill //Click on skill WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]", 10000); SkillBtn.Click(); //Click on skill to be edited WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[last()]/tr/td[1]", 10000); SkillToSel.Click(); //Click on Edit skill WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[last()]/tr/td[3]/span[1]/i", 10000); EditSkill.Click(); //Edit the skill //Add skill level WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "level", 10000); AddSkillLevel.Click(); new SelectElement(AddSkillLevel).SelectByText(ExcelLibHelper.ReadData(3, "SkillLevel")); Thread.Sleep(1000); }
internal void ValidateDeletedDetails() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "ManageListing"); // Refresh the page Driver.driver.Navigate().Refresh(); try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("DeleteListing"); //Verify deleted details var deletedListing = Driver.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr/td[3]")).Text; if (deletedListing != ExcelLibHelper.ReadData(3, "Title")) { Assert.Pass("Manage Listing deleted successfuly"); CommonMethods.test.Log(LogStatus.Pass, "deleted successfuly"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "ListingDeleted"); } else { Assert.Fail("Manage Listing not deleted"); CommonMethods.test.Log(LogStatus.Fail, "Listing not deleted successfuly"); } } catch { Console.WriteLine("Test passed, Listing deleted"); } }
internal void VerifyEditedSkill() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //Verify updated skill try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Edit skill"); //Jump to Skill tab //Click on skill WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]", 10000); SkillBtn.Click(); //Verify Skill Level WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[last()]/tr/td[2]", 10000); var lastRowSkillLevel = 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[last()]/tr/td[2]")).Text; Assert.That(lastRowSkillLevel, Is.EqualTo(ExcelLibHelper.ReadData(3, "SkillLevel"))); CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Skill Updated Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "SkillUpdated"); } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed"); Assert.Fail("Test failed to verify updated Skills", ex.Message); } }
public void WhenSellerClickOnEducationTabAndClickOnDeleteExistingEducationButton() { EducationPage educationPage = new EducationPage(); ExcelLibHelper.PopulateInCollection(ConstantHelpers.DataFilePath, "Education"); string originalCollegeName = ExcelLibHelper.ReadData(2, "CollegeName"); string NewcollegeName = ExcelLibHelper.ReadData(3, "CollegeName"); string country = ExcelLibHelper.ReadData(2, "Country"); string title = ExcelLibHelper.ReadData(2, "Title"); string degree = ExcelLibHelper.ReadData(2, "Degree"); string yearOfPassing = ExcelLibHelper.ReadData(2, "YearOfPassing"); educationPage.EducationDelete(NewcollegeName); bool isRecordPresent = educationPage.VerifyDegree(NewcollegeName, country, title, degree, yearOfPassing); // Assert.False(isRecordPresent); if (!isRecordPresent) { Assert.False(isRecordPresent); } else { Assert.Fail("Verification Failed."); throw new Exception("Result does not match"); } }
internal void EnterSkill() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //Click on skill WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]", 10000); SkillBtn.Click(); //Click on add new skill WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/thead/tr/th[3]/div", 10000); AddNewSkillBtn.Click(); //Add new skill WaitHelpers.WaitForElementVisibility(Driver.driver, "Name", "name", 10000); AddSkillBox.Click(); AddSkill.SendKeys(ExcelLibHelper.ReadData(2, "Skill")); //Add skill level AddSkillLevel.Click(); new SelectElement(AddSkillLevel).SelectByText(ExcelLibHelper.ReadData(2, "SkillLevel")); Thread.Sleep(1000); }
public static void Verifyskilledit() { ExcelLibHelper.PopulateInCollection(@"D:\\Mars\\AdvancedTaskTeam-master\\onboarding.specflow-master\\MarsQA-1\\SpecflowTests\\Data\\ProfileData.xlsx", "Skill"); var ActSkilllevel = Skilllevelvalue.Text; Assert.AreEqual(ActSkilllevel, ExcelLibHelper.ReadData(3, "Level"), "Skill level is changed"); }
internal void ValidateAddcertifications() { //Validate the certification is added sucessfully try { ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues"); String expectedValue = ExcelLibHelper.ReadData(3, "Certificate"); //Get the table list IList <IWebElement> Trows = driver.FindElements(By.XPath("//form/div[5]/div[1]/div[2]/div/table/tbody/tr")); //Get the row count in table var rows = Trows.Count; for (var i = 1; i <= rows; i++) { ExtentionHelpers.TurnOnWait(driver); string actualValue = driver.FindElement(By.XPath("//form/div[5]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text; //Check if expected value is equal to actual value if (expectedValue == actualValue) { SaveScreenShotClass save = new SaveScreenShotClass(); string img = save.SaveScreenshot(driver, "certification added"); } } } catch (Exception) { Assert.Fail(); } ExtentionHelpers.TurnOnWait(driver); }
internal void VerifyEditedCertification() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "Profile"); // Refresh the page Driver.driver.Navigate().Refresh(); //verify updated certification //verify certification try { //Start the Reports CommonMethods.ExtentReports(); Thread.Sleep(1000); CommonMethods.test = CommonMethods.extent.StartTest("Update Certification"); //Jump to Certification tab WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[4]", 10000); CertificationBtn.Click(); //Verify Certificate Year WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[last()]/tr/td[3]", 10000); var lastRowCertificateYear = 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[last()]/tr/td[3]")).Text; Assert.That(lastRowCertificateYear, Is.EqualTo(ExcelLibHelper.ReadData(3, "YearOfCertification"))); CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Certification Updated Successfully"); SaveScreenShotClass.SaveScreenshot(Driver.driver, "CertificationUpdated"); } catch (Exception ex) { CommonMethods.test.Log(LogStatus.Fail, "Test Failed", ex.Message); } }
//Delete a given Certification internal void DeleteCertification() { CertificationsButton.Click(); ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues"); String expectedValue1 = ExcelLibHelper.ReadData(4, "Certificate"); //Get the row list IList <IWebElement> Trows = driver.FindElements(By.XPath("//form/div[5]/div/div[2]/div/table/tbody/tr")); //Get the row count of table var rows = Trows.Count; for (int i = 1; i <= rows; i++) { //Get the xpath of ith row Name String actualValue = driver.FindElement(By.XPath("//form/div[5]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text; if (actualValue == expectedValue1) { // Click on delete button driver.FindElement(By.XPath("//form/div[5]/div[1]/div[2]/div/table/tbody[" + i + "]/tr/td[4]/span[2]/i")).Click(); } } }
public static void EditEducation() { ExcelLibHelper.PopulateInCollection(@"C:\AdvancedTaskLevel1\onboarding.specflow-master\MarsQA-1\SpecflowTests\Data\ProfileData.xlsx", "Education"); EducationEditiconFirst.Click(); CollegeName.Clear(); CollegeName.SendKeys(ExcelLibHelper.ReadData(3, "CollegeName")); SelectElement country = new SelectElement(CountryDropdown); country.SelectByText(ExcelLibHelper.ReadData(3, "CountryOfCollege")); SelectElement Titledrop = new SelectElement(TitleDropdown); Titledrop.SelectByText(ExcelLibHelper.ReadData(3, "TitleDrop")); Degree.Clear(); Degree.SendKeys(ExcelLibHelper.ReadData(3, "Degree")); Thread.Sleep(3000); SelectElement Yeardrop = new SelectElement(GradutionYearDropDown); Yeardrop.SelectByText(ExcelLibHelper.ReadData(3, "Year")); Thread.Sleep(3000); UpdateButtonEducationData.Click(); Thread.Sleep(5000); }
//Delete a given language internal void DeleteLanguage() { ExtentionHelpers.TurnOnWait(driver); //populate from excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues"); //expected value of language String expectedValue1 = ExcelLibHelper.ReadData(4, "Language"); //Get the table row list IList <IWebElement> Tablerows = driver.FindElements(By.XPath("//form/div[2]/div/div[2]/div/table/tbody/tr")); //Count how many rows var rowCount = Tablerows.Count; for (int i = 1; i <= rowCount; i++) { ExtentionHelpers.TurnOnWait(driver); //xpath of ith languagename(row) String actualValue = driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td[1]")).Text; if (expectedValue1 == actualValue) { //click on delete icon driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td[3]/span[2]/i")).Click(); Console.WriteLine("Language deleted"); } break; } }
public static void SelectAvailabilityvalue() { ExcelLibHelper.PopulateInCollection(@"C:\AdvancedTaskLevel1\onboarding.specflow-master\MarsQA-1\SpecflowTests\Data\ProfileData.xlsx", "ProfileData"); SelectElement Availobj = new SelectElement(Type); Availobj.SelectByText(ExcelLibHelper.ReadData(2, "Availability")); }
public ProfileLanguage(IWebDriver _driver) { driver = _driver; ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues"); PageFactory.InitElements(driver, this); }
internal void SetPassword() { //Populate excel data ExcelLibHelper.PopulateInCollection(ConstantHelpers.ExcelPath, "SignIn"); //Click on Name WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span", 10000); NameBtn.Click(); //Click on change password WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span/div/a[2]", 10000); ChgPwdBtn.Click(); Thread.Sleep(1000); //Enter old password WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[1]/input", 10000); CurrentPwd.Click(); CurrentPwd.SendKeys(ExcelLibHelper.ReadData(2, "NewPassword")); //Enter new password WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[2]/input", 10000); NewPwd.Click(); NewPwd.SendKeys(ExcelLibHelper.ReadData(2, "Password")); //Confirm new password WaitHelpers.WaitForElementVisibility(Driver.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[3]/input", 10000); ConfirmNewPwd.Click(); ConfirmNewPwd.SendKeys(ExcelLibHelper.ReadData(2, "Password")); Thread.Sleep(1000); }
public void WhenIAddLanguage() { //Reading the data from my C: file ExcelLibHelper.PopulateInCollection(@"C:\MARS QA\MARSQAProj\onboarding.specflow\MarsQA-1\SpecflowTests\Data\Data.xlsx", "Language"); //Identify the Add new button IWebElement AddNewButton = Driver.driver.FindElement(By.XPath("//div[@class='ui bottom attached tab segment active tooltip-target']//div[contains(@class,'ui teal button')][normalize-space()='Add New']")); AddNewButton.Click(); Thread.Sleep(1000); //Reading the Language Data from excel File IWebElement elementAddLanguageTxtBox = Driver.driver.FindElement(By.XPath("//input[@placeholder='Add Language']")); var expectedLanguage = ExcelLibHelper.ReadData(6, "Language"); elementAddLanguageTxtBox.SendKeys(expectedLanguage); Thread.Sleep(1000); //Identify/Choosing from the drop down language level IWebElement elementChooseLanguageLevelDropdown = Driver.driver.FindElement(By.Name("level")); SelectElement dropdownList = new SelectElement(elementChooseLanguageLevelDropdown); dropdownList.SelectByText("Fluent"); Thread.Sleep(1000); //Identify Add button IWebElement elementAddButton = Driver.driver.FindElement(By.XPath("//input[@value='Add']")); elementAddButton.Click(); Thread.Sleep(1000); }