But suppose the ad format changes to texts from banners, the selector is changing as well, but it shouldn’t change cause the position of the ad is same and it’s fixed.
Like here the ad format changes to text like this, it doesn’t work anymore:
Do you have any solution for cases like this? Also, are we supposed to use strict selector when it comes to dynamic selector or fuzy? Thanks in advance.
After little observation we can see that the dynamic selector might not work
instead what you can do is to use find children activity and get the last child of the advertisement aria-label so that you get the requried bottom advertisement always
Use find children with below as the filter…and in element indicate whole window
<webctrl aria-label='Advertisement' tag='DIV' />
then you get last element by uielementoutput.Last
this element is the whole bottom window…now from the bottom window if you need to click then just use click on it as by default it clicks on center you dont need to get to exact advertisement
if you want to get to it as well then make observations of what you might find in the different attributes and which attribute can be sued for filtering and getting the right element
In the initial case making a css selector is the only one which is making it unique no use of id class etc as they are same across all advertisements
In the later case selector is changing because the type of advertisement is different…try to correlate the ui changes to selectors then you can get at a better selector or a way around
HI Anil, Thanks for your effort and time. I tried to implement it, but it’s not clicking on the uielementoutput.Last like you said. See if I am doing it rightly:
Wow. now it seems to work. Only problem is that it is only taking Hardware events or windows message clicks, not taking simulate clicks, where as simulate is working on other parts of the site. I seem to miss something. Can you please check?
I see. Simulate click seems to disappear the error but the click is not happening in real. I even tried Simulate with delay before and windows-message with delay before.
If you’re getting idx in the selector you need to modify the selector - by using additional properties - so that it doesn’t need idx. You should avoid idx in your selectors.
<webctrl tag='*' />
This isn’t a valid selector. It will match literally anything. You have to learn to add properties from UI Explorer to modify selectors and make them unique. To make a selector dynamic you’d replace a value in the selector with a variable, not with *
Hi. Thanks again. I tried it, but sadly it’s not accurate as well. Failing 90% of the time
I have an idea. Is it possible to make clicks based on outgoing URLs? For example when I hover over the ads, it always starts with https://adclick.g.doubleclick.net/
So can we search for outgoing urls and based on that we can click on any url that starts with the above url? Is that possible on UiPath?
Thanks, Anil. There’s no error actually, it’s showing as success but the click isn’t happening sometimes.
And yes you are right, every ad will have the same URL not only the bottom one. But I am fine even if it clicks any one URL out of them, not specifically the bottom. Is that doable? How do I set it up in that case?
And thank you so much for your continuous response and effort, I really appreciate, you are one such a gem.