I'm super new and I cannot find the right xpath for this button

Hi Guys, Im new of this fields, and automation, I need to automatize this test but a hidden button is killing me.
I cannot find the right XPath, to make the system click the drop drown list and after the first option available.
may some one help me!!
thanks!

Your concern may stem from the unselectable attribute being turned on, so you might have to do some preliminary stuff before you select one of the items in the drop down. I have to let you figure that out.
For an xpath, you show us the span element, but not the actual drop-down parts, so I will assume they are labels (again, you figure it out):
If dynamic id:

//span[contains(@id, "splitbutton") and contains(@id, "-btnE1")]/label[1]

or if static id:

id("splitbutton-1089-btnE1")/label[1]
2 Likes

on short, as @grylion54 already explained, do the pre-requisites so the button became active and visible.
manipulating under the hood the code to bypass normal user behaviour is not a valid test scenario.

2 Likes

Thank you, May you can give me some tips on what you mean preliminary stuff as it’s like 3 days that I’m trying to replicate human steps to make the list visible but i’m stuck there.
I was just able to select the entire button ( left area it’s only reading) even trying to send the command down arrow doesn’t work but if I properly do it on the keyboard works.

please may can you help me to understand what i’m doing wrong or I don’t know yet.
I really need to finish this.

Good luck - testing is hardly ever “finished”.

What @bionel is saying is, don’t mess with the app just to make it pass. That would be a meaningless pass result. It’s unfortunate that @grylion54’s response could be viewed as suggesting that kind of thing – you really shouldn’t modify an app through testing.

What you need to do is… write test steps to put the application in the correct state so that the various fields and buttons work correctly for subsequent test steps. The test case should perform the same steps a user would perform.

I was trying to do it, giving command on the button, ( the one with the list) click on the arrow down or Keys input arrow down and then try to click the first option but all my tentative was a failure.

I’m not a coder, so I don’t know how to make ti work, I dunno if is the xpath or the commands wrong.

First things first…

Get the down-arrow to make the list appear. Until you can do that, everything else is noise.

You should target the HTML <a ...> element above the <span>.

And by the way, in your screenshot, you have a red arrow pointing to the pseudo-element :after – don’t waste any time on that element, it’s “not there”.

2 Likes

thank you very much!!!
with your tips on the right section where I have to target I got the result PASS!!
really thank you I should improve my skills on find the right HTML section to target.

Really really thank you, you made my day!

2 Likes