I have a dropdown list of 5 options. I’m trying to verify that all options are present in the list, but I keep getting errors. I’ve tried testing using all the options and using just one option. I’ve also tried using Verify Options Present and get the same errors. I’m using this to verify one of the options is present: WebUI.verifyOptionPresentByValue(findTestObject(‘Page_jsfccpartner Package Roger CPA Review/span_Custom Package (180000)’),
‘AUD - CPA Exam Review ($505.75)’, false, 0)
I’ve attached the errors I get. For some reason, Katalon is not letting me upload screenshots of the list and the html. I’ll keep trying.
Error 1.txt (3.6 KB)
Error 2.txt (3.9 KB)
the exception says:
WebElementNotFoundException: Web element with id: 'Object Repository/Page_jsfccpartner Package Roger CPA Review/span_Custom Package (180000)' located by 'By.xpath: //*[@name = 'product_id' and @value = 'AUD - CPA Exam Review ($505.75)']' not found
So doublecheck that XPath is correct.
I’ve double checked that. If this forum would let me upload a .png file, I’d share the html code with you, but I’m unable to upload .png files at this time.
You’re definitely 100% sure you’re dealing with a
<select> element containing a bunch of
<option> elements… right?
Well I just found out from one of the developers that the options are hidden and they’re using a bootstrap(?) to display the options. Not really sure I understand this but I think Katalon can’t see the options since they’re hidden. I still can’t upload a .png file to this thread.
Hmm… the error you received should/could certainly be more clear.
So now you need to figure out how to code what a user actually does to reveal the dropdown. My guess is, the select/option elements are hidden and their content copied to a bunch of visible elements (could be DIVs, UL/LI elements, whatever).
Right-click on one option when it’s displayed and choose “Inspect element”… what do you see in the devtools?
But is that EXACTLY the html that appears when you perform the action on the dropdown elements?
Are you sure it’s not this?
Open that UL element and look at its content.
I’m hoping your devs have been consistent…
Here’s another dropdown from your site:
You should be targeting that stuff. If you look at my Inspector, go for the elements with
event written next to them starting with the first
<button> element you can see in the image (it has a click handler in the event block so that seems like a good bet).
That’s not relevant as it’s a completely different dropdown in a different part of the site. I’m going in a different direction, but thanks for your help. You can delete this thread if you want.