SelectOptionByValue not working

I am not sure why, when I use the proper syntax and variables for selectOptionByValue, it is not working. Due to this, I am using the selectOptionByIndex for time being.

Can you please suggest to proceed further ? OR Is there any other way to use this ?

WebUI.selectOptionByValue(findTestObject(‘Object Repository/ORTC04/Page_Govt Inquiry/select_All Contracts’), bllmodass, false, FailureHandling.STOP_ON_FAILURE)

If bllmodass is your value, you miss the quote

It is not exact value and it is variable. Due to that I have not given the quote.

That’s why there is an “if” :wink:
Have you error message ?

It is not clear. what is “if” ?
Do you want error message ?


Hi Helene,
Here is the error log for reference. Please suggest to proceed further.

2019-07-17 18:18:04.300 ERROR c.k.k.c.c.keyword.CucumberReporter - :x: user select the assigned to name “Veerareddy Venkat” FAILED.
groovy.lang.MissingMethodException: No signature of method: CreateSaveReport002.findTestObject() is applicable for argument types: (java.lang.String, java.lang.String, com.kms.katalon.core.model.FailureHandling) values: [Object Repository/ORTC02/Page_New Report/select_AssignToList, …]
at CreateSaveReport002.user_select_assigned_name(CreateSaveReport002.groovy:203)
at ✽.user select the assigned to name “Veerareddy Venkat”(C:/Users/vxxxxxx/Katalon Studio/Govt Inquiry/Include/features/002-Create Save Report.feature:28)

Share your test case code too

I believe the issue is how you are handling that variable. From your snippet, everything matches. Assuming that the variable you have is set as type ‘String’ then you should be good.

.findTestObject() is applicable for argument types: (java.lang.String, java.lang.String, com.kms.katalon.core.model.FailureHandling)

This is telling you how it should look and from what you added, the only thing that really could that this off is the variable.

the error message is self explanatory.
the exception it is not raised in the code snipet posted, but in a different method.
so, without the full code, we can do blind guesses for a century, without a solution

No signature of method: CreateSaveReport002.``

Hi… please find the below code… Please suggest to proceed further.

@And("user select the assigned to name (.*)")
def user_select_assigned_name(String assignedto) {
	if(runIndicator2!='N') {
		println " assignedto " + assignedto
		WebUI.selectOptionByValue(findTestObject('Object Repository/ORTC02/Page_New Report/select_AssignToList'), assignedto, false, FailureHandling.STOP_ON_FAILURE)

This part of your error seems to be referencing something other than the method you shared above. It looks like you have an error in your script at line 203 where you have something like this:

findTestObject(‘Object Repository/ORTC02/Page_New Report/select_AssignToList’, someString, FailureHandling.OPTIONAL)

Can you post a screenshot of how you have ‘assignedto’ variable setup in Katalon?

Thanks for all your inputs.
Below is the Groovy code and attached the cucumber feature file line highlighted in red.

Code in Groovy:
@And(“user select the assigned to name (.*)”)
def user_select_assigned_name(String assignedto) {
if(runIndicator2!=‘N’) {
println " assignedto " + assignedto
WebUI.selectOptionByValue(findTestObject(‘Object Repository/ORTC02/Page_New Report/select_AssignToList’), assignedto, false, FailureHandling.STOP_ON_FAILURE)