Katalon Studio selecting Option Twice, Triggering Alert


#1

Have a test that is running like so.

WebUI.openBrowser(’’)
WebUI.selectOptionByIndex(findTestObject(‘Page_test/select_1010’), 5)
WebUI.selectOptionByIndex(findTestObject(‘Page_test/select_1010’), 6)
WebUI.selectOptionByIndex(findTestObject(‘Page_test/select_1010’), 9)
WebUI.closeBrowser()

I’ve also tried selectOptionByValue and selectOptionByLabel, but Katalon is selecting the first value twice after it selects the second value. It should select 5, 6, and then 9.


#2

Can you share the HTML for the select element AND all its OPTION elements too?


#3

Hi,
You can use WebUI.selectOptionByIndex(findTestObject('Page_test/select_1010'),'5,6,9')
See Param ‘range’ from the doc


#4

Hi. I tried this and that didn’t work.


#5

I can’t. It executes find in Edge, but not in Chrome or in FireFox.


#6

Why? Is it a top-secret government site or something? If you can’t share, we can’t figure out what’s wrong. :confused:


#7

Like @Russ_Thomas has said, we ideally need to see the HTML of the available options, before as well as after you select one of them. My guess is that maybe after you select an option from the list, that option then disappears from the HTML, which is throwing off your subsequent selections.

But again, we can only guess without seeing what you are working with.