// Fill propertyType void PropertyType(string propertyType) { // click the PropertyType DpdPropertyType.Click(); // wait fot the lsit to show up IWebElement listPropertyType = Driver.WaitForElementExist( By.XPath("/html[1]/body[1]/div[2]/div[1]/form[1]/fieldset[1]/div[2]/div[2]/div[1]/div[2]"), 5); var lists = listPropertyType.FindElements(By.TagName("div")); foreach (var item in lists) { if (item.Text == propertyType) { item.Click(); } } }
public void PropertyType(string propertyType) { //use js to execute on invisible element************************** // IJavaScriptExecutor js = (IJavaScriptExecutor) PublicPandM.PropertiesAndMethods._driver; // js.ExecuteScript("arguments[0].click()", DpdPropertyType); //click the PropertyType DpdPropertyType.Click(); //wait fot the lsit to show up IWebElement listPropertyType = new WebDriverWait(PublicPandM.PropertiesAndMethods._driver, TimeSpan.FromSeconds(5)).Until( ExpectedConditions.ElementExists( By.XPath( "/html[1]/body[1]/div[2]/section[1]/form[1]/fieldset[1]/div[2]/div[2]/div[1]/div[2]"))); var lists = listPropertyType.FindElements(By.TagName("div")); foreach (var item in lists) { if (item.Text == propertyType) { item.Click(); } } }