Issue with selecting option from dropdown


#1

Hello

I am facing issue with selecting a option from dropdown. Infact page contains two dropdown one is filter and other one is sort with same options. When i run test on filter dropdown it actually selects option from sort dropdown. I don’t know how to handle this issue. can anyone provide solution for this?

Thank you


#2

#3

I asked for help here. If anyone is facing same issue and found solution for that , then they will sure share the solution. But not expected this rude reply.

Thank u


#4

Hello creta,
if you think that description you give us is detailed enough, i can tell you - is not…
I’m not rude. You are!
I’m investing my time to comunity to try to help people with idea that every time i’m helping somebody to learn more and become better in QA and Katalon.
And you are wasting my time by not providing details. I was ready to help you… now, now i don’t care.
Good luck finding solution to problem you cannot properly describe.
Andrej


#5

Thank you for your time and reply!!


#6

Hi Creta

I wrote the article you claimed was rude. That article has received over 1600 views on this forum and in that time it has received 33 likes and has been pinned globally across the site.

You are the first person to complain about it

How would you improve it?

What is rude about it?

The fact is, in making the post you made, you are precisely the audience it is intended for. @Andrej_Podhajsky is a very knowledgeable and helpful participant on these forums but with the best will in the world, he does not have the superpowers to perceive your issue, your app, your test code across time and space to help you. That is why he responded with my article, to remind you, we are not gods, we need your help to help you.

If you know of a better way, please let us know – we are all here to learn.


#7

I’m sorry that you felt that the response was rude, however, I believe that it was justified. Many of this community’s leaders are very knowledgeable and passionate about the tool and about test automation in general, so it can be frustrating when we receive extremely vague questions like:

To demonstrate this, I will give you a solution that has as much effort put into it as you put into asking the question in the first place:

The solution is to make sure you are picking an option from the filter dropdown instead of the sort dropdown.

Was that helpful to you? Probably not.


#8

Russ_Thomas
Brandon_Hein
Andrej_Podhajsky

Hi all,

I am sorry for the word “rude”. It happend cause my deadline to finish work was near and was facing lot issues. I got frustrated when i received such a long message from Andrej_Podhajsky. I do undestand you guys are really helping people here and this is not my first topic here. I have created many more topics and received proper solution for that. I have been using katalon since last one year. I really appreciate your time and patience.

Thank you
Creta


#9

Hello all :slight_smile:
@Russ_Thomas
@Brandon_Hein
@Andrej_Podhajsky

Here is the issue which i am facing with dropdown. My application looks something like below

and I want to pick “Number” option from search dropdown as shown in image. But when i run my test scripts sometime it picks option from search dropdown and sometime it picks option from sort dropdown.

My scripts looks like below.


Also attached object properties details.

Can anyone help me to solve this issue ?
I hope my given details are clear now:)

Thank you
Creta


#10

Hello,
In your object properties, you are selecting an “li” tag, with text “Number” : I believe it matches both “li” from search Filter and sort options. You should add more properties (with xPath maybe) to match the correct object.

Another solution you should consider is to use selectOptionByValue on “VendorDropdown”.


#11

@Antoine_Bulteau’s answer is the correct one: you need a more specific locator for the Search dropdown. If you can show us the HTML for the dropdown and its options, we can give you an xpath that will work for sure.


#12

Hi
I tried using select option by value but i am getting below error. Can you please check this one?
1

Thank you


#13

Hi @creta

Can you show us the content of this Test Object ? Did you modify anything before using Select Option by Value ?

Regards !


#14

Hi @ThanhTo

I didn’t modify anything. Here is the test object content

Thank you!


#15

Hi @creta

Since internally SelectOptionByValue casts the element into a Select, but your test object’s tag name is span, therefore an error is thrown. Can you show us the content of the XPath section of the test object ? There may be something usable there.

Regards !


#16

Hi @ThanhTo
yeah please find the xpath for the object

Thank you


#17

@creta

Please try the third XPath, the one using the text “Search”. Since you want to select element from the search dropdown, I think this may work.

Regards !


#18

hi @ThanhTo

Can you tell me how can i use this in scripts? or I should add something in test object properties itself?

Thank you


#19

@creta

There’s a textrea called Selector Editor below the XPath section of the Test Object , please copy the third XPath and paste it there. Then save the Test Object and you can use it in your script already. Oh and remove the SelectByOptionValue, just use the script you posted originally.

Regards !


#20

@ThanhTo

Tried using same but still it selects option from sort dropdown. Not from search dropdown:(

Regards!