18 January 2026:


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.

On click of image.

rakeshsilswalrakeshsilswal Members
edited November -1 in Sahi - Open Source
I have a screen on which each row has image in it, it can be either red, green or blue image. And this in my test script i want to test a sequence in which i am clicking a 2nd row image, luckily i know its a red color image. One more info each image of same type has same name (for e.g. if i have 3 red color image than each one is named as red.gif).

I am writing this code.
_setValue(_password("username"), "*****");
_setValue(_password("password"), "*****");
_click(_submit("Log In"));
_click(_image("dark_red_arrow_down.gif",_near(_cell("CANADIAN EQUITY"))));

"CANADIAN EQUITY" is in the first column of the table and image is in the 2nd column.

Now when I am clicking playback, control is coming to this screen but nothing happens, and on the sahi controller i can see last statement as "--Stopped Playback: SUCCESS--".

In real flow, after clicking this link control goes to 2nd level screen, but in sahi it just remains on home page.

Comments

  • rakeshsilswalrakeshsilswal Members
    edited May 2011
    i have tried following option as well, but no luck.

    _click(_image("dark_red_arrow_down.gif",_in(_row("CANADIAN EQUITY"))));

    While recording SAHI gave me different identifier for elements around the image for e.g. for that particular row, sahi showed me _row(23), but when i try using it during my playback I was not able to navigate anywhere.
  • narayannarayan Administrators
    Hi Rakesh,

    1) Could you please try again with the latest Sahi? (Released on 25 May 2011)?

    2) Also try

    _click(_xy(_image("dark_red_arrow_down.gif",_near(_cell("CANADIAN EQUITY"))), 5, 5));

    3) Is the dark_red_arrow_down.gif only available when you mouse over it?


    Else we will have a desktop sharing session to see what the problem could be.

    Regards,
    Narayan
  • Thanks Narayan,

    It worked perfectly, i just took new build and it worked with my original script itself _click(_image("dark_red_arrow_down.gif",_in(_row("CANADIAN EQUITY"))));

    You can close this.
This discussion has been closed.