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.

Can't populate readonly fields in Firefox, but works fine in Explorer

mathos00mathos00 Members
edited November -1 in Sahi - Open Source
Hello,

Been playing with Sahi for a bit now, and the system has shown itself to be quite useful in handling active webpages.

However, I have a strange issue with this bit of HTML code:

<input type="text" class="input-text" value="" name="dnf_class_values[job][job_start]" js_required_field="Posting Date" onchange="fieldComparison(this,'job_end','<=','Expiration Date')" readonly="" no_submit="" maxlength="10" minlength="0" size="10" id="dnf_class_values_job__job_start_">

As you can see, there is a bit of java in this snippet, and it has "readonly" in it.

Nevertheles, under Explorer, if I issue the Sahi command:

_setValue(_textbox("dnf_class_values[job][job_start]"), "2001-10-3");

it will set the value of the field to 2001-10-3, just as we would like.

But under Firefox, that same command will not set the value. The field will remain blank.

Trying to edit the field manually, under either broswer, or course does not work (as would be expected).

If it is of any help:

System: Windows 7 x64, with all updates
Firefox: 3.6.3
Explorer: 8

Is there a solution for this, or is this just Firefox rigidly enforcing the "readonly?"

Thanks!

Comments

  • narayannarayan Administrators
    _setValue is supposed to work like a person typing in the commands, especially for text fields. The correct behavior should be that neither of these browsers should update the value. (And that is the behavior from our next build)

    If you really want to change the field, which I assume is a date field which you want to populate directly instead of using the date widget, you should do

    _call(_textbox("dnf_class_values[job][job_start]").value = "2001-10-3");

    This way, you are bypassing the UI and directly setting the value via javascript. (This is not a strict UI test)

    Regards,
    Narayan
  • mathos00mathos00 Members
    Thanks a million. That does the trick!
This discussion has been closed.