How do the activities involving image work?

When working with web automation, I’ve noticed that activities which involve images sometimes work and sometimes don’t. Usually, it’s due to differences in scale or resolution. But in some cases it seems weird that an image works for one page and not the other when both have technically the exact same image.

For example, a button “next” in a form that goes on for several pages. It’s the same image, the same font, the same size, same everything for all 10 pages. The only difference might be the position of the button in the page. But the activity only works for the first page.

That got me thinking that ElectroNeek works with coordinates when dealing with images. I’m just curious to know how it works.

1 Like

@cris-dsc When dealing with images (web applications) browser picker will pick the attributes of elements (classname,value,id etc) including hierarchy.
In your case, even though button attributes are same, other parameters might be different for each form. you can manage these easily using ’ Advanced options’ while picking element.
Please refer below document and see if it helps

1 Like

Thank you for the info. The example I metioned is a real situation I encountered during development. I tried using the Advanced Options in the browser picker, but it didn’t work. All the buttons from all pages shared the same attributes excpet for one that changed dynamically with random numbers (I think for security reasons). I didn’t include such attribute because it would generate “Cannot find element” errors.

So I tried using image instead. I thought “Well, it’s the same button, same font, same size, same colors… If I select the button from the 1st page, it will certainly work for all pages.” But I was mistaken. Didn’t work. I would have to select an image for all buttons, which didn’t make sense. The solution was to use XPath. And even that gave me a huge headache to make it work.

That’s why I got curious to know how images work in Studio Pro. I’d like to know that in order to be able to predict how it’s going to behave ad if it’s appropriate for that part of the project. The project is done and working now. I just want to know how actiities with image work. Do they need the coordinates to work properly?

@cris-dsc You mean you are using click on Image activity for the buttons?
image
If yes, This activity is useful in cases when it’s not possible to use selectors or coordinates to perform a click and this activity only works on one computer screen. If you have multiple screens, the activity will only work on the first (main) screen.
You can find details in below article

Hello @cris-dsc, We would like to know if the solution we provided here worked for you. If it did, please mark the post as a solution.