Hello,
I am facing one problem;
I am working on application what contains a lot of the same fields (same attributes), so somehow relative path doesn’t work . For example ; I have field : “Select country” and the same field apears if you click on button “Create” (it will be opened modal dialog box where is field with the same attributes). So, I am not able ;
1. identified lablel
2. perform click on it
3. select one of value
So, any of you face the same problem (that some field are generated from database and have the same attributes) just on different position , so writing aps xpath is too much long , any idea
This application is made to perform activities different perspective.
@Russ Thomas, thank you yes, I am going to add this (my code)
import org.openqa.selenium.support.ui.Select;
WebElement countries = driver.findElement(By.xpath("//li[.=‘BELGIUM’]"));
new Select(driver.findElement(By.xpath("//li.[.=‘BELGIUM’]"))).selectByVisibleText(“BELGIUM”);
I tried so many solution ;
one of them , first to find //li.[.=‘BELGIUM’], it was not possible,
than , I tried to find label(“Select county”) to click on it
WebElement action = driver.findElement(By.xpath("//label[@for=‘Select country’]"));
action.click()
but even this failed (label is not clickable or there is another element “modal dialog” what also get clik). My problem is that I have huge application with a lot field (select by value) with the same attributes , so somehow relative xpath failing , so, I have no idea (create class what identified just modal dialog box) I have no idea , thank you
What we are using Prime NG