Previously, I successfully implemented this code, however, the HTML/CSS for the dropdown has since changed and now I am unable to get it to function correctly.
Below is the structure for the dropdown code, with specific text highlighted that I am trying to identify:
I have set up a web element for the button that triggers the dropdown, retrieved its text, and checked if it contains certain criteria:
val myDropDown = driver.findElement(By.xpath("""//*[@id="no-jcf"]/div[2]/div[3]/form/div[18]/div[2]/div[2]/ol/button"""))
val ans = myDropDown.getText().contains("Copy of Invoice")
Despite following these steps, the code is not functioning as expected and returning an incorrect result.