I wants to choose select value from dropdown list and data will be read through excel file. I have write piece of code. still its not work. Please anybody can help.
here are my code:
WebUI.selectOptionByValue(findTestObject(‘your chosen object’),
findTestData(‘Read data for Name of your excel sheet’).getValue(“Name of the dropdown”, row), true)
Hope this will help you.
Thanks,
@nazneen@ragrawal@Arnel
Can you share the working code . Have used the below code but it dint work
WebUI.selectOptionByValue(findTestObject(‘Object Repository/Web/span_Tanzania’), findTestData(‘data’).getValue(‘SelectCountry’,
1), true, FailureHandling.OPTIONAL)
@ayesha.khanam You are using selectOptionByValue method on a span element (span_Tanzania). That won’t work. The selectOptionByValue and selectOptionByLabel methods are for a select tag.
@grylion54 Facing below issue after changing it to WebUI.verifyMatch(WebUI.getText(findTestObject(‘Object Repository/Web/span_Tanzania’)), findTestData(‘data’).getValue(‘SelectCountry’,1), false, FailureHandling.OPTIONAL)
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.getText() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.String, java.lang.Boolean, com.kms.katalon.core.model.FailureHandling) values: [TestObject - ‘Object Repository/Web/span_Leso’, Leso, …]
Possible solutions: getText(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), setText(com.kms.katalon.core.testobject.TestObject, java.lang.String, com.kms.katalon.core.model.FailureHandling), getText(com.kms.katalon.core.testobject.TestObject), setText(com.kms.katalon.core.testobject.TestObject, java.lang.String), getUrl()
@ayesha.khanam The error message, MissingMethodException, means we do not have the statement correct. The statement does not match the proper context for parameters. In particular, the getText method.
If you copied and pasted from this forum, make sure all smart quotes, they have a curve or curl to them, are changed into straight quotes. (Just redo all the quotes within KS.) Also, the error message is stating span_Leso, not span_Tanzania. But check the type of quotes you have and then we will see if the error message goes away.
If you copy and paste from this forum, make sure all smart quotes, they have a curve or curl to them, are changed into straight quotes. (Just retype all the quotes within KS.)
Am trying to select the label from the drop down by using this “WebUI.selectOptionByLabel(findTestObject(‘Invoice/ExpMonth’),findTestData(‘CTInvoice’).getValue(‘ExpirationdateMonth’, row), false)” But it’s not working could you pls help me.