I’m having a strange problem with the repeate with each functionality. I’ve searched and tried examples from the forum, but it’s just not quite working for me.
I have Eggplant v1.5, and I’m trying to iterate through a list to verify imagefound.
I have a list I created with this syntax:
put("file1","file2","file3") into TestResultImages
I then attempt the following loop (I used pictureimage to make sure it wasn’t a reserved word, I know it looks dumb):
repeat with each pictureimage of TestResultImages if not ImageFound(pictureimage) then set errorMessage = "Test result image not found: " & pictureimage LogError errorMessage end if end repeat
When I execute this selection, I get
File not found: imagefound Error - Couldn’t Open Image File: “TestResultImages”
I’m new to EggPlant, so I’m sure I’m doing something dumb, but honest, I searched before asking. Of interest, in the line “repeat with each pictureimage of TestResultImages” the word ‘of’ is not colored or bolded in any way, which suggests to me that the interpreter doesn’t recognize it as a reserved word. Not sure if that’s normal or not, but I don’t get a syntax error. Instead, it gets to the imagefound and expects the filename to be the name of the list.
Thanks in advance!