selectOptionByValue is not working for drop down

My code is not working for a drop down value.
WebUI.selectOptionByValue(findTestObject(‘Migration REQ Creation/Page_SID detail (1)/select_-- None --ISM Code Migr’), ‘ISM Code Migration Request’,

true)  

This value “ISM Code Migration Request” exists in the drop down field. same code is working for other field though with different object name and value.

I am getting this message

05-15-2018 07:52:25 PM - [FAILED] - Unable to select option by value ‘ISM Code Migration Request’ of object ‘Object Repository/Migration REQ Creation/Page_SID detail (1)/select_-- None --ISM Code Migr’ using regular expression (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Migration REQ Creation/Page_SID detail (1)/iframe_gsft_main’ located by ‘By.xpath: //iframe[@src = ‘com.glideapp.servicecatalog_cat_item_view.do?sysparm_catalog=e0d08b13c3330100c8b837659bba8fb4&v=1&sysparm_clear_stack=yes&sysparm_id=955920d1f9ead144cddb5c767d805bb8&sysparm_nameofstack=fddd78564fc2d3c0255b2f6d0210c7c0&sysparm_link_parent=5aff385f1d7ff100b7633835df15e261’ and @name = ‘gsft_main’ and @id = ‘gsft_main’]’ not found)

05-15-2018 07:52:25 PM - [END] - End action : selectOptionByValue

05-15-2018 07:52:25 PM - [END] - End Test Case : Test Cases/ISM L2 catalog item REQ creation

05-15-2018 07:52:25 PM - [FAILED] - Test Cases/ISM L2 catalog item REQ creation FAILED because (of) Unable to select option by value ‘ISM Code Migration Request’ of object ‘Object Repository/Migration REQ Creation/Page_SID detail (1)/select_-- None --ISM Code Migr’ using regular expression (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Migration REQ Creation/Page_SID detail (1)/iframe_gsft_main’ located by ‘By.xpath: //iframe[@src = ‘com.glideapp.servicecatalog_cat_item_view.do?sysparm_catalog=e0d08b13c3330100c8b837659bba8fb4&v=1&sysparm_clear_stack=yes&sysparm_id=955920d1f9ead144cddb5c767d805bb8&sysparm_nameofstack=fddd78564fc2d3c0255b2f6d0210c7c0&sysparm_link_parent=5aff385f1d7ff100b7633835df15e261’ and @name = ‘gsft_main’ and @id = ‘gsft_main’]’ not found)

It would help if I could see some of the HTML you are using.

The error is quite clear: that element as specified by your TestObject, is not present on the page.

Check:

Spelling (watch for UPPERCASE and lowercase errors)
Spaces
Is the element VISIBLE at the time the test step is executing?
Are you sure it’s a SELECT element with OPTION elements inside it? If not, you’re using the wrong WebUI API.

Is your object inside iframe? (iframe_gsft_main)
If it is, check if your iframe is dynamic and it’s id is changing every time you open it.
That means your xpath is not valid and you need to adapt/change it

1 Like

Hi crokatalontest,
thank you so much. you are correct. It worked by changing the correct iframe path :slight_smile: