Select dropdown value by read data from excel

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(‘Object Repository/Add Listing/Page_Workilo Create Listing/select_Please SelectAssemblyCr’),

findTestData('Read data for Add listing').getValue("Category", row), true)
1 Like

Hi Nazneen,

Does it have any error message? If so, can you provide?

Arnel said:

Hi Nazneen,

Does it have any error message? If so, can you provide?

Hi Anrel
Its working fine now and I appreciate for your reply but you are quite late :slight_smile: I hope next time you will respond quickly
Thanks :slight_smile:

Hi Nazneen,

what you make changes in your code? now i am facing same issue.

Hi,

I have used the below code for Select dropdown

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,

It is not working for me…

Hi Nazneen,
Can you please share your manual and scripted mode along with xpath of object repository, how did you do it. I am new to katalon.

I really need your help to complete my test case.

Hi I want the code for this please it’s urgent

@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)

Hi Ayesha,

Instead of using selectOptionby value use click command and put the value in the obj repo.

If you didnt able to resolve your concern. Please let me know at rausa1608@gmail.com

We can discuss there thru zoom call and resolve your concern

@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.

Maybe you could use:

WebUI.verifyMatch(WebUI.getText(findTestObject(‘Object Repository/Web/span_Tanzania’)), findTestData(‘data’).getValue(‘SelectCountry’,1), false, FailureHandling.OPTIONAL)

Also, you are using true for the boolean in your statement. If there is no Regular Expression in your parameters, you should set the boolean to false.

@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.

Oh, and ensure you have the correct number of closing parenthesis on the getText statement of the span_Leso statement! There should be two.

WebUI.verifyMatch(WebUI.getText(findTestObject('Object Repository/Web/span_Leso')), findTestData('data').getValue('SelectCountry',1), false, FailureHandling.OPTIONAL)

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.)