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.

Need to check the existence of image

lawrencelawrence Members
edited November -1 in Sahi - Open Source
I need to check whether the image exists or not with the below code. Any help?

</td><td align="center" valign="middle">
<a id="gridEventTitle_ctl02_EditButton" href="javascript:__doPostBack('gridEventTitle$ctl02$EditButton','')"></a>
<input type="image" name="gridEventTitle$ctl02$EditImage" id="gridEventTitle_ctl02_EditImage" title="Edit" src="../images/icon_edit.gif" alt="Edit" style="border-width:0px;" />

Comments

  • Got the same problem...

    I can't recognize broken images. I tried to do a http HEAD Request, but the Sahi proxy changes the response. Instead of 404 - Not Found it says 200 Ok -.- any workaround?
    any help on this is very appreciated.

    Regards
    Wormi
  • Hi lawrence,

    You can use:

    _assertExists(_imageSubmitButton("Edit"));

    This will return true if the image exists.

    Let me know if this solves your issue.

    Regards
    Sumitra
  • globalwormingglobalworming Moderators
    edited September 2011
    Hi Sumitra

    _assertExist isn't working with me. It says true, cause there is an broken image with the same ID.
    Please have a look at https://www.muenchenticket.de/guide/organizer/c0v/EHC+Muenchen+Spielbetriebs+GmbH.html and the _image("Veranstalter Logo").
    Is there any way I can be sure this image exists and is showing something other than these broken image?
Sign In or Register to comment.