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.

Want to know how to enter value in particular field with sahi.

sujatasujata Members
edited November -1 in Sahi - Open Source
I am not bale to enter value in one pariticular field.
Like in my application,there multiple text boxes .eg,
Consult visit :
Regular visit:
Regular check up:

But the problem is that every time the order of text boxes are not same.
some times consult visit comes on the top,and sometimes regular visit etc.
Is there any way ,where i 'll mention that enter value in consult visit text box.

Comments

  • Hi Sujata,

    Use Regular expressions in your script to identify the object. then your problem will be resolved..
  • sujatasujata Members
    Regular expressions is not working ,for this case.Because as we need to to specify to enter value only in 1 particular field.
  • sujatasujata Members
    Hi custom apparelZ,
    I think your response is not related to my problem.So before replying anyone,first you should know what's his/her problem,then come in the field to solve the problem.
  • Hi Sujata,

    The order of the input fields doesn't matter.

    Please record and playback once by entering data as you desire and paste the scripts so I can have a look at it.

    Alternatively, you can debug the property of the input field using "Firebug" add-in for Firefox. Please share the part of script so that I can understand the question better.

    Thanks,
    Chandan.
  • tsivatsiva Members
    Hi sujata,
    I think your issue could be resolved by using _near or _under methods. Here is an example for _near(). You may also check at the below url:

    http://sahi.co.in/w/all-apis


    link("delete", _near(_cell("User Two"))) points to the nearest link with text “delete” near cell with text “User Two”.
    Note that we do not need to specify "delete[1]" since it is the delete.
    link
    nearest to User Two.

    Here is another example similar to that:
    _click(_image("s.gif", _near(_textbox("docStatusComboId"))));
Sign In or Register to comment.