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.

The first parameter passed to _setValue was not found on the browser

vamsi17vamsi17 Members
edited November -1 in Sahi - Open Source
Hi I am trying to automate a GWT application every thing was going smooth but when i give some text value i am facing the error.

Here is my script and i am using firefox 3.0.5 version

_setValue(_textbox("x-auto-29-input"), "admin");
_setValue(_password("x-auto-30-input"), "password");
_click(_button("Login"));
_click(_div("x-auto-91"));
_click(_span("Roles"));
_click(_span("Users"));
_click(_span("User Groups"));
_click(_span("Resource Rates"));
_click(_span("Resource Calendar"));
_click(_span("Base Calendar"));
_click(_div("x-auto-255"));
_wait(20000);
_assertExists(_div("x-auto-255")); // THIS LINE HAS BEEN ADDED
_wait(20000);
_setValue(_textbox("name"), "test_1");
_wait(20000);
_click(_button("Save"));
_click(_button("Ok"));
_click(_image("x-auto-300"));
_click(_image("x-auto-302"));
_click(_button("Save"));
_click(_button("Ok"));

Any Help Please..

Comments

  • narayannarayan Administrators
    Hi Vamsi,

    x-auto-xx ids should not be used for identifying elements as they will keep changing.

    Open sahi/htdocs/spr/concat.js, search for
    Sahi.prototype.isIgnorableId = function(id){
        // zkoss, extjs, xilinus, gmail
        return id.match(/^z_/) || id.match(/^j_id/) || id.match(/^ext[-]gen/) || id.match(/^[:]/);
        //  || id.match(/_[0-9]{10,}_/);
    };
    

    and replace it with
    Sahi.prototype.isIgnorableId = function(id){
        // zkoss, extjs, xilinus, gmail
        return id.match(/^z_/) || id.match(/^j_id/) || id.match(/^ext[-]gen/) || id.match(/^[:]/) || id.match(/x[-]auto[-]/);
        //  || id.match(/_[0-9]{10,}_/);
    };
    

    Restart Sahi, clear browser cache and record those steps again. Sahi will no longer use the x-auto ids to identify the elements, and will give you some other stable identifier, which should work across various runs.

    Regards,
    Narayan
Sign In or Register to comment.