how to check an image exist through iteration

i have a green tick and a red mark which will be in a web application , i have to check whether if green tick there i have to write pass and if red i have to write fail
1.i have used element exist in a for each loop but it is searching the greentick only
2.get attribute also didnt work
any help is appreciated

Have you tried using Image Exist activity?

i used image exisst also and it is not giving me the right answer .if i change selector in it it is giving false everytime. i change the selector to iterate the green check marks

hey @Palaniyappan do u have any solution ?

check the difference between Green and Red tick Selectors!
and update accordingly!
Cheers
@Jebarohith19

check with ? image exist?
it has a class name which differntiate red and green ticks so how do i iterate this?

1 Like

did you Inspect the selector from web??
see the major changes!

yes @Pradeep_Shiv major change is the class name and tablerow.
tablerow will change like 1,2, and so on
if i inspect greentick i have classname=“greencheck” and for redtick i have classname=“redcheck”
so i iterate with table rows but it doesnt give me the solution

2 Likes

then you class name!
use get Attribute and get the Class Name then you can build a condition based on this!
like if classsNameVar.ToString.Contains(“GreenCheck”)

try this and let me know
Cheers!

2 Likes

yes i tried that too but it worked for the greenticks inside a for loopbut when it checks for red tick it gives me error like improper selector
uielement not found for the third iteration which is a red tick

1 Like

can i see the selector which you are using??

1 Like

html app=‘chrome.exe’ htmlwindowname=‘new’ title=‘Job Scheduler’ />
<webctrl parentid=‘allPackagesTable’ tag=‘I’ class=‘fa fa-check success-color’ tableRow=‘2’ /for greenctick

html app=‘chrome.exe’ htmlwindowname=‘new’ title=‘Job Scheduler’ />
<webctrl parentid=‘allPackagesTable’ tableRow=‘4’ tag=‘I’ class=‘fa fa-times danger-color’ tableCol=‘5’ / for redtick

1 Like

Remove Class and Table row/Col

if i remove tablerow how can i iterate it through for loop?
and if i remove checksuccescolour what attribute shid i check?

1 Like

iteration like this im doing please tell a acorrect way to iterate

you are looping fine!
you can remove from the selector,get it from Get Attribute it’s changing so youre getting error!

if i inspect greentick i have classname=“greencheck” and for redtick i have classname=“redcheck”
so i iterate with table rows but it doesnt give me the solution

can i see this

this is the get attribute selector , so when i remove class from selector when i give class as attribute it will show attribute not found @Pradeep_Shiv

which website you are using ??
Can i check?

image

1 Like