Hello
I’m trying to create a robot that will do a search in web form and depending on the result the click options are different.
May occur randomly…
I don’t know what is the best strategy to execute this?
1 the search returns nothing so I go back to the search
Hey
Thanks for the help, it worked perfectly with a few tweaks.
But in one of the options I need to download the image, only it is stored in an S3 bucket so when I click on the download button it opens another browser tab…
So how do I right click the browser and download the image?
It actually made it a little more complicated, because sometimes it’s jpg images and sometimes it’s pdf.
So the browser behavior is different. when it is jpg it opens another tab and when it is pdf it downloads directly
Hi @Rodrigo_Buch , The “Click” activity allows you to define if it is a right or left click. Look at the " MouseButton property in the properties panel of “Click”.
You can also try and do a “Get Attribute” of the element where the PDF/JPG is and then check if it is PDF/JPG. Once you know, you can act accordingly!
Is the download button a hyperlink or is there any where else from where you can get the name of the file? If yes, you can do a GET ATTRIBUTE (activity) to try and get the filename - if that ends in a .pdf, it is a pdf; in .jpg, it is a jpg.
Also, try looking at the source code of the page, if this is a webpage and search for .pdf and/or .jpg to see if the name is available.
Other option could be to click the download button and then check if a new file is downloaded. If it is, good (move on). If not, trigger the download image code.
what I’m doing is that the robot will search for invoice numbers from an xlsx and when there is a file, download it, but sometimes it’s a pdf and other times it’s images and the browser works differently for PDF and images
I don’t know if it would work…
thought I’d use Elements Exists and check that element from the PDF if it finds it click save or use a SendHotkey “crtl +s” and save
so … why you dont try intead with click Right Botton and save it? seems to me that will work in any case. Or you just need to save ONLY the pdf ? in that case I think that your solution is ok aswell.