Need suggestion on folder setting

Click "Mod A/imagea1"
Click "Mod A/imagea2"
Click "Mod B/imageb1"
Click "Mod B/imageb2"

Can you suggest a shorter way not to include the folder name every time like Mod A,Mod B in the above example.
Something can we set search folder pat Mod A ,Mod B ?Assuming there wont be any duplication image name in those folders
then adding only images in the code like click image a1.

Also if i want to click 1+ times in a row how to do it. I tried like
Click “imagea1”,“imagea2”,…“imagea10” but it once clicked the first image it goes for the next statment.

There’s not really a way to do what you’re asking. eggPlant always searches for the images relative to the suite’s Images folder; there’s no way to set the starting point to a folder lower in the hierarchy.

Click “imagea1”,“imagea2”,…“imagea10” is the same as saying ClickAny or using a collection. eggPlant will click the first image in the list that it finds. You would need to put your images in a list and then iterate over the list. If your images are actually named as in your example (which I’m guessing they’re not) you could do this:

repeat 10 times
     click "imagea" & repeatIndex()
end repeat

Thanks Matt for clarification.and your guess is right too :lol: about the naming conversion.

Here is what i created

set Searchpath1 to "Module A/" -- Setting image folder path
set p to Searchpath2  -- Simplified text  for coding
Click p & "bt_image1"

Where im going wrong in the above code

It doesnot really clicking the image. It suppose to do

Click "Module A/bt_image1"

You set searchPath1 and then set p to searchPath2, which as far as I can tell doesn’t exist. I thought about suggesting this approach, but it didn’t seem to save enough effort to make it worthwhile. Plus, it potentially obscures errors – if you’re typing the path, it’s easier to see if you’ve got the reference correct.

Sorry it was just typo error

set Searchpath1 to "Module A/" -- Setting image folder path 
set p to Searchpath1  -- Simplified text  for coding 
Click p & "bt_image1"

The main reason for doing is that,Later if we want to change the path,folder name,or the image location is it very easier to change only few areas.

Any suggestion where I’m going wrong ?

Look closely for typos – I did a sanity check here with an analogous image and path and it worked fine. If you’re not getting an error saying either that the image file doesn’t exist (meaning that there’s something wrong in your strings) or that the image was searched for but not found, then you’re seeing a problem with where the click is actually going. This kind of issue should be handled through e-mail – it’s no longer really a good exchange for the forums.

The root cause was due to the mouse speed i think .Before the Click I’m entering a long characters in a text field.Due to that,it is not able to click immediately after entering text.I jus added a wait time between this two operations like

wait 2

Seems like all set now :smiley:

Thanks for all your suggestions Matt

When first collecting images, particularly when I’m doing proof of concept test development, using the default image names image0001… imageYYYY makes some sense. However, when done you may want to name your images with something useful, like “AcceptButton”, or “SubmitButton”, or even “AvatarOfCurrentUser”, the latter maybe a collection if you are testing multiple users in a chat program for instance.

As for path setting, I have found organization of images to discover/test for is best done in a well defined and thought out hierarchy of test and project folders with the Images folder. However, if you must externalize your images for various reasons (maybe for archiving or flexibility purposes in theme or design changes), simply do as you have discovered and set a ProjectImagePath variable (use whatever name you want) and then use the following idea here shown in pseudo code.

to masterHandlerName params
set ProjectImagePath to “/Path/To/Images/For/This/Test/”
repeat with each in “TestOneName,TestTwoName,…,TestNName”
send it with params as parameters
end repeat
end masterHandlerName

Hope this helps, the ideas are more important than the untested pseudo code provided above.

Thanks todd.Its helps a lot