public static int Main() { double[] darray = { 1.0, 2.0, 3.0 }; double[] clone = OneOff.Clone(darray); Console.WriteLine(clone.Length); return(clone.Length == 3 ? 0 : 1); }
internal void AddShareSkill() { ExcelLib.PopulateInCollection(Base.ExcelPath, "ManageListings"); GlobalDefinitions.WaitForElement(ShareSkillButton, 30); ShareSkillButton.Click(); GlobalDefinitions.WaitForElement(Title, 30); Title.SendKeys(ExcelLib.ReadData(2, "Title")); Description.SendKeys(ExcelLib.ReadData(2, "Description")); Category(CategoryDropDown, ExcelLib.ReadData(2, "Category")); SubCategory(SubCategoryDropDown, ExcelLib.ReadData(2, "Sub Category")); Tags.SendKeys(ExcelLib.ReadData(2, "Tags")); Tags.SendKeys(Keys.Enter); OneOff.Click(); OnLine.Click(); StartDateDropDown.SendKeys(ExcelLib.ReadData(2, "Start Date")); EndDateDropDown.SendKeys(ExcelLib.ReadData(2, "End Date")); Sunday.Click(); SundayStartTime.SendKeys(ExcelLib.ReadData(2, "Sunday Start Time")); SundayEndTime.SendKeys(ExcelLib.ReadData(2, "Sunday End Time")); Monday.Click(); MondayStartTime.SendKeys(ExcelLib.ReadData(2, "Monday Start Time")); MondayEndTime.SendKeys(ExcelLib.ReadData(2, "Monday End Time")); Tuesday.Click(); TuesdayStartTime.SendKeys(ExcelLib.ReadData(2, "Monday Start Time")); TuesdayEndTime.SendKeys(ExcelLib.ReadData(2, "Monday End Time")); CreditOption.Click(); if (SkillExchangeOption.Selected) { SkillExchange.SendKeys(ExcelLib.ReadData(2, "Skill Exchange")); } else { CreditAmount.SendKeys(ExcelLib.ReadData(2, "Credit")); } Hidden.Click(); Save.Click(); }
internal void SelectServiceType() { //enter service type if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service") { OneOff.Click(); } else { hourBasis.Click(); } }
internal void ServiceType() { //entering the service type if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service") { hourlyBasis.Click(); } else { OneOff.Click(); } }
internal void EditShareSkill() { //Thread.Sleep(3000); GlobalDefinitions.Wait(3000); ManagementListingBtn.Click(); //Thread.Sleep(2000); GlobalDefinitions.Wait(2000); GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "EditShareSkill"); try { //Thread.Sleep(1000); GlobalDefinitions.Wait(1000); var table = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody")); //table var manageListRow = table.FindElements(By.TagName("tr")).ToList(); //all rows picked var isFound = false; // var rows = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr")); //each row and coloum for (int i = 1; i <= manageListRow.Count; i++) { var row = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]")); //each row and coloum var columnList = row.FindElements(By.TagName("td")).ToList(); //all coloum for (int j = 1; j <= columnList.Count; j++) { var oldManageList = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[" + j + "]")); //each row and coloum //click on edit button with specific row and column if (oldManageList.Text == "Code") { isFound = true; _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[2]/i")).Click(); //edit button break; } } if (isFound) { break; } } if (isFound) { Thread.Sleep(1000); //Add Title {edit value update from (Code)} EditTitle.Clear(); EditTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EditTitle")); //Thread.Sleep(1000); GlobalDefinitions.Wait(1000); //Add Description EditDescrp.Clear(); EditDescrp.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description")); //Thread.Sleep(1000); GlobalDefinitions.Wait(1000); //Service type OneOff.Click(); //Thread.Sleep(1000); GlobalDefinitions.Wait(1000); //Skill Trade EditCredit.Click(); CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount")); //Thread.Sleep(1000); GlobalDefinitions.Wait(1000); Save.Click(); } else { Console.WriteLine("Test Fail, Edit un-successful"); } } catch (Exception ex) { throw; } }