Download Images

uiautomation

#1

Hi,
I am currently working on a project where I have to download images from CMS. When the images are uploaded to CMS a link to the image is automatically generated, the problem I am having is how to download these images, I am unsure how to get the correct selector and how to loop through each image download. I have attached a sample of the HTML code with the image links, I would be grateful if someone can point me in the right direction.test.html (5.5 KB)


#2

Hey there. I took a look at the HTML code you uploaded. The partial selector for the first image looks like this: webctrl aaname=‘IMG_2560A.jpg’ tag=‘A’ /
What exactly do you mean by getting the correct selector?
As far as how to loop through each image download - my suggestion is to create a directory and download all images to there. Then you can just loop through that directory for each image.


#3

Thanks for your response. the number of images to download varies each time. My question is how do I find the number of images in CMS and then download them, thanks for your help.


#4

Do you necessarily need the number or do you just need to find all of them? For the number, you’d probably have to use a count variable. Maybe try screen scraping and use the matches activity to find all items that end with ‘.jpg’ or whatever other extension you’re looking for. then create a variable and parameterize the selector and feed in every match you found. The number of items in the match array would be the number you assign to your count variable. Does that help?


#5

Hi, I just need to find all images and then download them, find attached a sample of a process that I was testing. test.xaml (8.8 KB)
I would appreciate it if you could take a look, thnks


#6

I took a look, but I’m not sure exactly what you’re asking me about it? It looks like xaml doesn’t really do anything except highlight one specific image. If you’re trying to look for all images, you’re going to have to make the selector for highlight dynamic by remove the specific image number and replacing it with *.


#7

Thank you Michelle, I have managed to solve the issue, I used the selector and as you mentioned I used the * to select all images, I looped through all and clicked and saved each image, thanks for your help