Make Click Image work correctly

uiautomation
studio

#1

Hello,

I’m using click image to click an image/element in a web page. The problem is that the webpage has the same image located in two different places in the website. How can I make sure that my click image clicks the second image instead of the first.

Here’s a screenshot of the webpage in question :

Just for further information, here’s what happens when I click on the second image (A menu popouts) :

A normal didn’t work for me…this is why I’m using click image


#2

You could try using FindImageMatches activity and pass the second result (index 1) in the Click activity (Element property).
Or you could grab a larger image (with the Modifier word) as well - you could use Citrix Wizard with it’s Click Relative for easier setup.
Or you could use Click Relative from the Settings (the cog icon).
Or you could try sending a normal click to the dropdown box (if it’s identifiable) and send Alt+down to expand the dropdown.

I suppose you already tried Select Item and it didn’t work?


#3

Hello Obee
You can find the fixed image in the page and you could indicate the position to click on it.Click Image

In your case if you want to click on the first image

identify the image with text “Plus”.
Click on indicate as shown in image.
now select the drop-down icon.

Let me know if you need a work case.
Hope this helped.


#4

Hello,
I’m trying to use the first proposition but I don’t know how to access the second result given it’s not a list that it’s being returned, and the methods of IEnumerable didn’t work. I may be doing something wrong


#5

Can you please explain how you are trying to use click image activity.

I’m attaching a small example for your reference, here I’m clicking on the first “See All” so I have fixed “Duke” as anchor image and indicating “see all” with reference to “Duke”.

Main.xaml (13.5 KB)
project.json (306 Bytes)


#6

Since this is an IEnumerable there are 2 ways of accessing the second element that come to mind:

Converting it to array will let you access by index. You could also use a .ToList call.
UiElement secondArrow = yourResultAsIEnumerable.ToArray()(1)

Or you could skip the first one and take the first. Here I’d use FirstOrDefault and check for Nothing afterwards.
UiElement secondArrow = yourResultAsIEnumerable.Skip(1).FirstOrDefault()