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.

Recording on a disbaled text field

sanket.pattekarsanket.pattekar Members
edited November -1 in Sahi - Open Source
Hello,

I am recording a web application that has an html form. This form has many enabled text fields and one disabled ID field and a Save button. When the form is loaded, the disabled field is empty. I enter the values in the enabled fields and click on the save button. After save the disabled field is populated with some system generated ID.

While recording, I am able to record every thing upto the save button click. However I need to get the value of disabled field (after save is clicked). Sahi apparantly does not generate any event when I click/double click this disabled field. Is there any way to capture this ?

Browser: Not specific
OS: Windows XP
Sahi Version: 3.5

Sanket Pattekar

Comments

  • My Suggestion is enhance ur code with

    _getText ( el )

    will return system generated ID


    take help from http://sahi.co.in/w/?q=text
  • My problem is that I do not get the identifier during recording as there is no event

    Having look at the web page, I do see that this disabled textfield does have a unique id and name. The problem is that Sahi does not produce any event for click on textfield

    Sanket
  • Hi sanket,

    Try with the following,
    _click(_button("save"));
    var $txtbox=_textbox("/.*/",_under(_textbox("nearestTextBox Identifier")));
    _assertTrue($txtbox.disabled);
    var $disabledTextBoxValue=_getText($txtbox);
    _alert($disabledTextBoxValue);
    

    This might help you.

    let us know if the problem persists.

    Regards,
    Theeran.
  • Emihle2010Emihle2010 Members
    edited August 2012
    Hi team,

    How to check if a textbox or a button is disabled using he if statement?
Sign In or Register to comment.