internal ServiceListing viewListedService() { GlobalDefinitions.wait(10); IList <String> list = new List <String>(); if (verifyListingAvabilability()) { var title = table.FindElement(By.XPath("//table/tbody/tr[1]/td[3]")).Text; list.Add(title); var category = table.FindElement(By.XPath("//table/tbody/tr[1]/td[2]")).Text; list.Add(category); var description = table.FindElement(By.XPath("//table/tbody/tr[1]/td[4]")).Text; list.Add(description); var serviceType = table.FindElement(By.XPath("//table/tbody/tr[1]/td[5]")).Text; list.Add(serviceType); view.Click(); } if (list.Count != 0) { return(new ServiceListing(list)); } else { return(null); } }
internal void register() { GlobalDefinitions.wait(5); //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignUp"); //Click on Join button Join.Click(); //Enter FirstName FirstName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "FirstName")); //Enter LastName LastName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "LastName")); //Enter Email Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Email")); //Enter Password Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); //Enter Password again to confirm ConfirmPassword.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ConfirmPswd")); //Click on Checkbox Checkbox.Click(); //Click on join button to Sign Up JoinBtn.Click(); }
public void WhenIEnterTheRegisterDetail() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "SignUp"); GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div/div/div[1]/div/button")).Click(); GlobalDefinitions.wait(120); //Enter FirstName GlobalDefinitions.driver.FindElement(By.XPath("//input[@placeholder='First name']")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "FirstName")); //Enter LastName GlobalDefinitions.driver.FindElement(By.XPath("//input[@placeholder='Last name']")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "LastName")); //Enter Email GlobalDefinitions.driver.FindElement(By.XPath("//input[@placeholder='Email address']")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Email")); //Enter Password GlobalDefinitions.driver.FindElement(By.XPath("//input[@placeholder='Password']")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); //Enter Password again to confirm GlobalDefinitions.driver.FindElement(By.XPath("//input[contains(@placeholder,'Confirm Password')]")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ConfirmPswd")); //Click on Checkbox GlobalDefinitions.driver.FindElement(By.XPath("//input[contains(@type,'checkbox')]")).Click(); //Click on join button to Sign Up GlobalDefinitions.driver.FindElement(By.XPath("//div[contains(@id,'submit-btn')]")).Click(); }
public void WhenIClickOnTheDeleteButton() { //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "Profile"); try { for (var i = 1; i <= 10; i++) { var textcode = GlobalDefinitions.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[1]")).Text; Console.WriteLine(textcode); if (textcode == GlobalDefinitions.ExcelLib.ReadData(3, "Language")) { //Wait GlobalDefinitions.wait(20); //Click the Delete button GlobalDefinitions.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[2]/i")).Click(); break; } } } catch (Exception) { Console.WriteLine("Test Failed"); } }
internal void AssertEditEdu() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); GlobalDefinitions.wait(40); //String ActEdu = (GlobalDefinitions.driver.FindElement(By.XPath("//div[@data-tab='third']//tbody//tr[1]//td[1]"))).Text; //Assert.IsTrue(ActEdu.Contains(GlobalDefinitions.ExcelLib.ReadData(3, "Country"))); //Assert University String ActEdu1 = (GlobalDefinitions.driver.FindElement(By.XPath("//div[@data-tab='third']//tbody//tr[1]//td[2]"))).Text; Assert.AreEqual(ActEdu1, GlobalDefinitions.ExcelLib.ReadData(3, "University")); //Assert Title String ActEdu2 = (GlobalDefinitions.driver.FindElement(By.XPath("//div[@data-tab='third']//tbody//tr[1]//td[3]"))).Text; Assert.AreEqual(ActEdu2, GlobalDefinitions.ExcelLib.ReadData(3, "Title")); //Assert Degree String ActEdu3 = (GlobalDefinitions.driver.FindElement(By.XPath("//div[@data-tab='third']//tbody//tr[1]//td[4]"))).Text; Assert.AreEqual(ActEdu3, GlobalDefinitions.ExcelLib.ReadData(3, "Degree")); //Assert year String ActEdu4 = (GlobalDefinitions.driver.FindElement(By.XPath("//div[@data-tab='third']//tbody//tr[1]//td[5]"))).Text; Assert.AreEqual(ActEdu4, GlobalDefinitions.ExcelLib.ReadData(3, "YearOfGraduation")); }
internal ManageListings clickOnSaveBtn() { GlobalDefinitions.wait(20); // Click on Save button Save.Clicks(); return(new ManageListings()); }
private void chooseSkillTrade(IWebElement element, string trade, string skillExc, string credit) { if (trade == "Skill-Exchange") { element.FindElement(By.XPath("//div[@class='ui radio checkbox']/input[@value = 'true' and @name='skillTrades']")).Click(); if (SkillExchange.Displayed && SkillExchange.Enabled) { SkillExchange.EnterText(skillExc); SkillExchange.EnterText(Keys.Enter); } else { Console.WriteLine("Skill Exchange textbox is not avaiable"); return; } } else if (trade == "Credit") { IWebElement Credit = element.FindElement(By.XPath("//div[@class='ui radio checkbox']/input[@value = 'false' and @name = 'skillTrades']")); Credit.Click(); GlobalDefinitions.wait(5); if (CreditAmount.Displayed && CreditAmount.Enabled) { CreditAmount.EnterText(credit); } else { Console.WriteLine("Credit textbox is not avaiable"); return; } } }
public void ThenItShouldDisplaySentRequests() { try { //Start the Reports Base.test = Base.extent.StartTest("Validate Sent Requests"); GlobalDefinitions.wait(10); string ExpectedValue = "Sent Requests"; string ActualValue = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='sent-request-section']/div[2]/h2")).Text; GlobalDefinitions.wait(10); if (ExpectedValue == ActualValue) { Base.test.Log(LogStatus.Pass, "Test Passed, sent to Sent Requests page Successfully"); SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Sent Requests"); } else { Base.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
//Validate new Language internal void ValidateAddUpdLanguage(int excelrow) { try { GlobalDefinitions.wait(30); //click on language button // LanguageButton.Click(); GlobalDefinitions.WaitForElement(driver, By.XPath("//table/tbody/tr[last()]/td[1]"), 30); string LanguageText = driver.FindElement(By.XPath("//table/tbody/tr[last()]/td[1]")).Text; Console.WriteLine(LanguageText); Console.WriteLine(GlobalDefinitions.ExcelLib.ReadData(excelrow, "Language")); if (LanguageText == GlobalDefinitions.ExcelLib.ReadData(excelrow, "Language")) { Assert.IsTrue(true); } //validate language //Assert.AreEqual(GlobalDefinitions.ExcelLib.ReadData(excelrow, "Language"), LanguageText); } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail(); } }
internal void ViewandDeleteListings() { //Populate the Excel Sheet of Manage Listings GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\Rammy\Desktop\marsframework\MarsFramework\ExcelData\TestDataManageListings.xlsx", "ManageListings"); //Wait GlobalDefinitions.wait(10); //Click on Manage Listing tab under Profile page manageListingsButton.Click(); //Click on View button and send to View page view.Click(); //Go back to Manage Listing page from View page Base.Back(); //Click on Active slider ActiveSlider.Click(); //Click on delete button delete.Click(); //Popup come up after clicking delete button and click yes button clickActionsButton.Click(); }
internal void EditDescription() { try { Thread.Sleep(2000); // Click on Description Icon Description.Click(); GlobalDefinitions.wait(9000); // Enter Description EnterDescription.Clear(); EnterDescription.Clear(); EnterDescription.Clear(); EnterDescription.Clear(); EnterDescription.SendKeys("Hi Sruthi"); GlobalDefinitions.wait(2000); //Click on Save button DescriptionSave.Click(); GlobalDefinitions.wait(2000); // Validate if user edited description successfully // Validate if user added description successfully string ExpectedValue = "Description has been saved successfully"; string ActualValue = GlobalDefinitions.driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text; // Assert Condition for adding description Confirmation message if (ExpectedValue == ActualValue) { // Print in Console Console.WriteLine("Passed - user edited description successfully"); } else { // Print in Console Console.WriteLine("Failed - user not edited description"); } //Write Log reports Base.test.Log(LogStatus.Info, "user edited description successfully"); } catch (Exception e) { //take screen shot and save with given name GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "user not edited description"); // write log reports Base.test.Log(LogStatus.Info, "Editing description -Test Failed", e.Message); } //Write Log reports Base.test.Log(LogStatus.Info, "Clicked edit Description Icon"); }
internal void ProfileAdd() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//i[@class='dropdown icon'])[2]")); //Click Profilename ProfileName.Click(); //Enter Firstname Firstname.Clear(); Firstname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Firstname")); //Enter Lastname Lastname.Clear(); Lastname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Lastname")); //Save profilename SaveProfileName.Click(); var fname = GlobalDefinitions.ExcelLib.ReadData(2, "Firstname"); var Lname = GlobalDefinitions.ExcelLib.ReadData(2, "Lastname"); var title = fname + " " + Lname; GlobalDefinitions.wait(40); Assert.AreEqual(Titlename.Text, title); }
//Add Education internal void AddEducation() { GlobalDefinitions.WaitForClickableElement(driver, By.XPath("//a[text()='Education']"), 30); EducationButton.Click(); GlobalDefinitions.wait(30); AddNewEducation.Click(); //adding text in institute name InstituteText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University")); // select dropdown selectdropdown("country", GlobalDefinitions.ExcelLib.ReadData(2, "Country")); selectdropdown("title", GlobalDefinitions.ExcelLib.ReadData(2, "Title")); selectdropdown("yearOfGraduation", GlobalDefinitions.ExcelLib.ReadData(2, "Year")); //enter degree DegreeText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree")); GlobalDefinitions.wait(30); // add education btnAddEducation.Click(); GlobalDefinitions.wait(30); }
//update education internal void UpdateEducation() { GlobalDefinitions.WaitForClickableElement(driver, By.XPath("//a[text()='Education']"), 30); EducationButton.Click(); String ExpectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "University"); //Get the table list IList <IWebElement> TRows = driver.FindElements(By.XPath("//table/tbody/tr")); //Get the row counts var rows = TRows.Count; //for (int i = 1; i <= rows; i++) //{ // GlobalDefinitions.wait(30); // //get xpath // String ActualValue = driver.FindElement(By.XPath("//table/tbody/tr["+i+"]/td[2]")).Text; // //check value // if (ActualValue.Equals(ExpectedValue)) // { //CliCk on update pen icon driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td[6]/span[1]/i")).Click(); //update uni IWebElement editRowValue = driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td/div/div[1]/input")); editRowValue.Clear(); editRowValue.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "University")); // update Country of College new SelectElement(driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td/div[1]/div[2]/select"))).SelectByValue(GlobalDefinitions.ExcelLib.ReadData(3, "Country")); // update Title new SelectElement(driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td/div[2]/div[1]/select"))).SelectByValue(GlobalDefinitions.ExcelLib.ReadData(3, "Title")); //update the Degree IWebElement EditDegree = driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td/div[2]/div[2]/input")); EditDegree.Clear(); EditDegree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Degree")); //update the Year new SelectElement(driver.FindElement(By.XPath("(//table/tbody/tr)[last()]/td/div[2]/div[3]/select"))).SelectByValue(GlobalDefinitions.ExcelLib.ReadData(3, "Year")); // Click on update button // driver.FindElement(By.XPath("//table/tbody/tr[" + i + "]/td/div[3]/input[1]")).Click(); //driver.FindElement(By.XPath("//input[contains(@value,'Update')]")).Click(); UpdateButton1.Click(); GlobalDefinitions.wait(500); Thread.Sleep(5000); Console.WriteLine("updated"); // } // } }
public void UpdateLanguage() { String brg = "spanish"; for (int j = 0; j < rowtable.Count; j++) { int i = j + 1; if (rowtable[j].Text == brg) { GlobalDefinitions.wait(20); GlobalDefinitions.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")).Click(); GlobalDefinitions.wait(20); GlobalDefinitions.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/div/div[1]/input")).Clear(); GlobalDefinitions.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/div/div[1]/input")).SendKeys("koren"); IWebElement Arg = GlobalDefinitions.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/div/div[2]/select/option[3]")); Arg.Click(); GlobalDefinitions.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/div/span/input[1]")).Click(); //GlobalDefinitions.wait(100); Thread.Sleep(2000); IWebElement Ele = GlobalDefinitions.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[1]")); Assert.IsTrue(Ele.Displayed); } } }
//validate deletion internal void ValidateDeleteLanguage() { try { String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "Language"); String expectedValue1 = GlobalDefinitions.ExcelLib.ReadData(3, "Language"); //get the table list IList <IWebElement> Tablerows = (IList <IWebElement>)driver.FindElements(By.XPath("//form/div[2]/div/div[2]/div/table/tbody/tr")); for (int i = 1; i <= Tablerows.Count; i++) { string actualvalue = driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td[1]")).Text; //check if expected value is not equal to actual value if ((expectedValue != actualvalue) || (expectedValue1 != actualvalue)) { Console.WriteLine("deleted Successfully"); Assert.IsTrue(true); } } } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail(); } GlobalDefinitions.wait(30); }
internal void profiledata() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\Owner\source\repos\marsframework-master\MarsFramework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ProfileData"); NameDrop.Click(); Fname.Clear(); Fname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Fname")); Lname.Clear(); Lname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Lname")); Assert.IsTrue(Save.Enabled); Save.Click(); GlobalDefinitions.wait(40); // Avail.Click(); // Availability.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Availability")); // GlobalDefinitions.wait(90); // Hrs.Click(); // Hours.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Hours")); // GlobalDefinitions.wait(90); // ETarget.Click(); // EarnTarget.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EarnTarget")); // Description.Click(); //Thread.Sleep(5000); // DescriptionDeta.Clear(); // string desc = GlobalDefinitions.ExcelLib.ReadData(2, "DescriptionData"); // DescriptionDeta.SendKeys(desc); // Assert.That(DescriptionDeta.Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(2, "DescriptionData"))); // Assert.IsTrue(Save1.Enabled); // Save1.Click(); }
//Add new Lanuguage internal void Addlanguage() { //explicit wait GlobalDefinitions.WaitForClickableElement(driver, By.XPath("//a[text()='Languages']"), 30); //firstly click on language button LanguageButton.Click(); //implicit wait GlobalDefinitions.wait(30); //click on add new button AddNewLanguage.Click(); GlobalDefinitions.wait(30); //enter text in language field LanguageText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language")); //select level from drop down new SelectElement(driver.FindElement(By.XPath("//select[@class='ui dropdown']"))).SelectByValue(GlobalDefinitions.ExcelLib.ReadData(2, "LanguageLevel")); GlobalDefinitions.wait(30); //click on add button AddLanguage.Click(); GlobalDefinitions.wait(30); }
private void selectSkillTrade(IWebElement element, string skillTrade) { if (skillTrade == "Skill-Exchange") { element.FindElement(By.XPath("//div[@class='ui radio checkbox']/input[@value = 'true' and @name='skillTrades']")).Click(); if (SkillExchange.Displayed && SkillExchange.Enabled) { SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange")); SkillExchange.SendKeys(Keys.Enter); } else { Console.WriteLine("Skill Exchange textbox is not avaiable"); return; } } else if (skillTrade == "Credit") { IWebElement credit = element.FindElement(By.XPath("//div[@class='ui radio checkbox']/input[@value = 'false' and @name = 'skillTrades']")); credit.Click(); GlobalDefinitions.wait(5); if (CreditAmount.Displayed && CreditAmount.Enabled) { CreditAmount.SendKeys("1"); } else { Console.WriteLine("Credit textbox is not avaiable"); return; } } }
public void WhenIAddNewCertificationDetails() { //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "Profile"); //Click on Add new Button GlobalDefinitions.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/thead/tr/th[4]/div")).Click(); //Wait GlobalDefinitions.wait(20); //Add Certificate or Award GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[1]/div/input")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certification")); //Add Certified From GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[2]/div[1]/input")).SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certified From")); //Click on Year IWebElement ChooseYear = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[2]/div[2]/select")); ChooseYear.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertYear")); ChooseYear.Click(); //Click on Add Button GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[3]/input[1]")).Click(); }
public void ValidateInvalidData() { //Populate in collection ExcelLib.PopulateInCollection(Base.ExcelPath, "Validate_contact"); //Navigate to test env GlobalDefinitions.driver.Navigate().GoToUrl(ExcelLib.ReadData(2, "Url")); GlobalDefinitions.wait(500); Email.SendKeys("bincy"); GlobalDefinitions.wait(1000); Phone.SendKeys("343434"); GlobalDefinitions.wait(1000); if (GlobalDefinitions.isDialogPresent(GlobalDefinitions.driver, ExcelLib.ReadData(6, "Locator"), ExcelLib.ReadData(6, "LocatorValue"))) { Console.WriteLine("Incorrect Email"); //Report generating with screenshot Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Incorrect Email"); string screenShotPath = CommonMethods.SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "InvalidData"); // test.Log(LogStatus.Fail, stackTrace + errorMessage); Base.test.Log(LogStatus.Pass, "Snapshot below: " + Base.test.AddScreenCapture(screenShotPath)); } else { Console.WriteLine("Elements not present"); } }
public void AddSkill() { if (rowtable1.Count < 4) { GlobalDefinitions.wait(50); // Click on Profile tab GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]")).Click(); //Click on add new button GlobalDefinitions.driver.FindElement(By.XPath("//*[@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")).Click(); //Add Skill GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/div/div[1]/input")).SendKeys("ISTQB"); //Click on Skill Level GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/div/div[2]/select")).Click(); //Choose skill level IWebElement Nan = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/div/div[2]/select/option[2]")); Nan.Click(); //Click add button GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/div/span/input[1]")).Click(); String arg = "ISTQB"; for (int j = 0; j < rowtable1.Count; j++) { int i = j + 1; if (rowtable1[j].Text == arg) { IWebElement Sun = GlobalDefinitions.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]")); Assert.IsTrue(Sun.Displayed); return; } } } }
public void ThenThatLanguageShouldBeDisplayedOnMyListings() { //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "Profile"); try { //Start the Reports test = extent.StartTest("Validate Language Added"); GlobalDefinitions.wait(10); string ExpectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "Language"); string ActualValue = GlobalDefinitions.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; GlobalDefinitions.wait(10); if (ExpectedValue == ActualValue) { Base.test.Log(LogStatus.Pass, "Test Passed, Added a Language Successfully"); SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "LanguageAdded"); } else { Base.test.Log(LogStatus.Fail, "Test Failed"); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Test Failed", e.Message); } }
public void UpdateSkill() { GlobalDefinitions.wait(50); // Click on Profile tab GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]")).Click(); String brg = "ISTQB"; for (int j = 0; j < rowtable1.Count; j++) { int i = j + 1; if (rowtable1[j].Text == brg) { GlobalDefinitions.wait(50);; GlobalDefinitions.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[3]/span[1]/i")).Click(); GlobalDefinitions.wait(50); GlobalDefinitions.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/div/div[1]/input")).Clear(); GlobalDefinitions.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/div/div[1]/input")).SendKeys("IISTQB"); IWebElement Arg = GlobalDefinitions.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/div/div[2]/select/option[3]")); Arg.Click(); GlobalDefinitions.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/div/span/input[1]")).Click(); Thread.Sleep(2000); IWebElement Sun = GlobalDefinitions.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]")); Assert.IsTrue(Sun.Displayed); return; } } }
internal void UploadWorkSamplesAutoIt() { // Click on Work Sample file upload button WorkSampleUploadButton.Click(); // AutoIt - Handles windows that do not belongs to browser AutoItX3 autoIt = new AutoItX3(); ////To activate the window("open" is the window name for chrome. if u click upload file button from mozilla or IE, the window name is different autoIt.WinActivate("Open"); // https://www.youtube.com/watch?v=vmWmCw_8WsE //defining driver wait GlobalDefinitions.wait(2000); Thread.Sleep(2000); // To Select file from a window autoIt.Send(@"F:\Tasks\fileuploadsample.txt"); //defining driver wait GlobalDefinitions.wait(2000); // To press open button -- so the file will get uploaded autoIt.Send("{ENTER}"); //Write in console Console.WriteLine("work sample file uploaded"); //Write log reports Base.test.Log(LogStatus.Info, "WorkSample File Uploaded"); }
public void AddCertification() { if (rowtable2.Count < 4) { GlobalDefinitions.wait(50); GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[4]")).Click(); //Click on add new button GlobalDefinitions.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/thead/tr/th[4]/div")).Click(); //Add certificate GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[1]/div/input")).SendKeys("SyssOps"); //Certificate Obtained GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[2]/div[1]/input")).SendKeys("AWS"); //Choose Year GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[2]/div[2]/select")).Click(); //Enter Year IWebElement ali = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[2]/div[2]/select/option[2]")); ali.Click(); //Click Add GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/div/div[3]/input[1]")).Click(); String arg = "SyssOps"; for (int j = 0; j < rowtable2.Count; j++) { int i = j + 1; if (rowtable2[j].Text == arg) { IWebElement All = GlobalDefinitions.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]")); Assert.IsTrue(All.Displayed); return; } } } }
internal void SearchData() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\Owner\source\repos\marsframework-master\MarsFramework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "Search"); SearchIcon.Click(); string expectedTitle = "Search"; string actualTitle = GlobalDefinitions.driver.Title; Assert.That(actualTitle, Is.EqualTo(expectedTitle), "Navigation to Search Page failed"); AllCategory.Click(); GlobalDefinitions.wait(30); GlobalDefinitions.driver.FindElement(By.XPath("(//a[@role='listitem'])[2]")).Click(); GlobalDefinitions.wait(90); OnlineBtn.Click(); OnsiteBtn.Click(); ShowAllBtn.Click(); GlobalDefinitions.wait(30); SearchSkillsBox.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title")); SearchLink.Click(); GlobalDefinitions.wait(60); Assert.That(ServiceInfo[0].Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(2, "Title"))); GlobalDefinitions.wait(30); SearchUser.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "User")); SearchUser.SendKeys(Keys.ArrowDown); SearchUser.SendKeys(Keys.Enter); Assert.That(SellerInfo[0].Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(2, "User"))); }
public void UpdateCertification() { GlobalDefinitions.wait(50); GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[4]")).Click(); String brg = "SyssOps"; for (int j = 0; j < rowtable2.Count; j++) { int i = j + 1; if (rowtable2[j].Text == brg) { GlobalDefinitions.wait(50); GlobalDefinitions.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[4]/span[1]/i")).Click(); GlobalDefinitions.wait(50); GlobalDefinitions.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/div/div/div[1]/input")).Clear(); GlobalDefinitions.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/div/div/div[1]/input")).SendKeys("Devops"); GlobalDefinitions.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/div/div/div[2]/input")).Clear(); GlobalDefinitions.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/div/div/div[2]/input")).SendKeys("ABS"); IWebElement Arg = GlobalDefinitions.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/div/div/div[3]/select/option[5]")); Arg.Click(); GlobalDefinitions.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/div/span/input[1]")).Click(); IWebElement All = GlobalDefinitions.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]")); Assert.IsTrue(All.Displayed); return; } } }
public void GivenIAmInProfilePageAndClickChangePassword() { GlobalDefinitions.wait(50); IWebElement UsernameNavigation = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/div[1]/div[2]/div/span")); Actions builder = new Actions(Global.GlobalDefinitions.driver); //builder.MoveToElement(UsernameNavigation).Build().Perform(); WebDriverWait wait = new WebDriverWait(GlobalDefinitions.driver, TimeSpan.FromSeconds(60)); //wait.Until(ExpectedConditions.ElementToBeClickable(UsernameNavigation)); AutoItX.MouseMove(1700, 150); GlobalDefinitions.wait(500); UsernameNavigation.Click(); GlobalDefinitions.wait(20); IWebElement ChangePassword = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/div[1]/div[2]/div/span/div/a[2]")); builder.MoveToElement(ChangePassword).Build().Perform(); wait.Until(ExpectedConditions.ElementToBeClickable(ChangePassword)); ChangePassword.Click(); }
// Delete a service with name of Selenium internal void deleteListedService() { //click on Manage Listimg tab clickOnManageListing(); // Click on Delete button if (verifyListingAvabilability()) { // Before Delete option int totalRow = getTotalRows(); delete.Click(); if (clickActionsButton.Displayed && clickActionsButton.Enabled) { clickActionsButton.FindElement(By.XPath("//div[@class='actions']/button[2]")).Click(); GlobalDefinitions.wait(15); if (verifyListingAvabilability()) { int currentRows = getTotalRows(); isServiceListed(totalRow, currentRows, "Delete"); } } else { Assert.Fail("Unable to delete"); } } else { Assert.Warn("No Service is listed for delete!"); } }