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.

How to manage Dynamic fields (if the fields names change dynamically)

GeorgeGeorge Members
edited November -1 in Sahi - Open Source
OS : Windows 7
Browser : Firefox 7.0.1
Sahi Build: 2011-07-19

Hi

Advise me.. How to manage Dynamic fields in a form (if the fields names change dynamically in the form on each run of my script)?
Let me make it clear by giving an example :

first time when i run the script the textbox fieldname will be say.. abc_1011_name
the second time the field name may change to abc_1013_name or abc_1015_name depends on the no of times many users used the same field to store/save data to db.

give a reply soon please.

George

Comments

  • Hi George,

    Kindly use : /abc_10/

    Check if this solves your issue.

    Regards
    Sumitra
  • even the abc_10 also may change... you know.. i cannot predict the fieldname.. its random generated most of the time. it may be abc_1022_name or bcd_3344_name.

    thats another problem.. so i want to know a solution how to take the fieldname which is used at the time i arrive the form.

    george
  • Hi George,

    In that case, you will have to use:

    /.*/ instead of abc_1022_name

    Check if this solves your issue.

    Regards
    Sumitra
  • if i have 3 fields with the names abc_2233_name, abc_2233_add, abc_2233_desgn and if i use /.*/ will it prompt to take from one after other? let me check... i don't know... if it doesnot pl give other solutions if any..

    thanks a lot

    george
  • Hi George,

    If you use /.*/ it will consider all the textboxs what ever is the id of the textbox.

    For Eg: If you want to set a value in the text box2 then /.*/ wont work because Sahi wont know where the textbox is present. In that case you will have to use DOM relation.( i.e _in(),_under(),_near()) API's.

    For more details: http://sahi.co.in/w/all-apis

    Regards
    Sumitra
  • ok i will try that.

    thanks sumitra


    George
Sign In or Register to comment.