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.

wildcards

Bluepma38Bluepma38 Members
edited November -1 in Sahi - Open Source
Are there any wildcard options when dealing with sahi objects? For example, on one page, I have to click a button. This button however, is always a different name like:

_image("edit_comment_63950")
_image("edit_comment_63951")
_image("edit_comment_63952")

So i'll never really know what # should be on the tailing end and there are no other elements on the page I can get the number from.

Are there any wildcards I can do like

_image("edit_comment_*")?

If not, can anyone think of a decent work around?

Thanks!

Comments

  • JaoBrJaoBr Members
    I think that this can help you:

    http://sahi.co.in/forums/viewtopic.php?id=1447

    I didn't tested it yet, but I think that your code might be something like this:

    _image(/edit_comment_.*/)
  • Worked like a charm. Thanks a ton for the response!
  • nagarnagar Members
    edited November 2011
    Hi,

    I am also having same problem. I have list of radio buttons with their names as say, "abc[1]", "xyz[1]", "pqrs[2]", "lmn[4]" etc.

    The index no. tailing behind is not static. But this wildcard solution is not working for me. I also tried _click(_radio(0,_near(_cell("/abc/"))));

    But this also is not working. Kindly help in this issue.


    Also, in my application I have few text boxes, which also are identified as "searchtext", "searchtext[1]", "searchtext[2]"...... by Sahi controller.

    Code lines: _setValue(_textbox("/searchtext/"), "any input");
    OR
    _setValue(_textbox(/searchtext.*/), "any input");

    do not work in this situation.

    Any help will be much appreciated.


    regards,
    nagar
  • nagarnagar Members
    edited November 2011
    Hello All,

    If anyone has any idea, Kindly help in this problem.


    Regards,
    nagar
  • Still looking for the solution. Please help.
  • Hi nagar,

    Can you please send us the HTML snippet of the radio buttons to support@sahi.co.in?

    Which browser are you using to set a value? What version of Sahi are you using?

    Also, could you please check if you are able to set values on other textboxes and other browsers.

    Regards
    Sumitra
Sign In or Register to comment.