So I have a dropdown like so:
which is a ul and li type list.
this is my script portion which calls the above:
this is the li item xpath, which I verified in browser that exists and points to correct item in dropdown (if I populate the FromAccount variable with an existing item), I also tested it during a test, I added a 30s delay and found it no problem in devtools:
have also tried xpaths like this:
for the li item
this is the element I click to open the dropdown which also clicks no problem:
What about trying:
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
def driver = DriverFactory.getWebDriver();
WebElement pItem = driver.findElement(By.id('ui-id-4'));
unfortunately I would need the element to be dynamic, if I wanted test2 for example that wouldnt work. this exact test with the same elements works no problem in my c# selenium project. Was hoping there was a way I could do this without a bunch of extra code. Has to be a reason why this isn’t working as intended, I just can’t see it
You can replace the id, such as “ui-id-4”, by a String variable that references your specific element’s id. Similarly, you can replace the By.id with By.xpath if you should need that and create a String variable of the xpath.
right right, was hoping to not have to do that and use katalons built in stuff. Odd but in the end I’m trying to see how much can be done if someone with little programming experience were to write this exact test.