18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to get collection of images in a page
Hi,
I am automating one application http://www.satyapaul.com, here click SAREES menu then Printed Embellished Sarees link, here we will get some images, in each page we will get 48 images, now i want all the images of that particular page into collection, means how can i get list of images by using "collectSimilar()" in sahi.
Regards,
Madan
I am automating one application http://www.satyapaul.com, here click SAREES menu then Printed Embellished Sarees link, here we will get some images, in each page we will get 48 images, now i want all the images of that particular page into collection, means how can i get list of images by using "collectSimilar()" in sahi.
Regards,
Madan
Comments
You can use something like this:
_collect("_image","/.*/",_accessor("document.body"));
Regards
Sumitra
How can i use the code which you have sent in java mode.
I tried with the below code in Eclipse and its giving the number of images of that particular page. but i am unable to click the image. Can you tell me why.
List<ElementStub> st=browser.div("img").in(browser.table("four-grid")).collectSimilar();
System.out.println(st.size());
st.get(1).click();
Try the following code:
Also, make sure that you have imported the dependencies in tha java file.
Regards
Sumitra