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.

Issue related with the _setValue(_textbox(digit), "User Value");"

HarshaHarsha Members
edited November -1 in Sahi - Open Source
Hi,

I have recorded a heirarchy from the website, below is the description of the scenario,

1) Created "Test" (Parent)

2) Under "Test" created Scenario1 (child 1)
Under "Scenario1 " created "2 Sub Scenarios"

3) Under "Test" created Scenario2 (child 2)
Under "Scenario2 " created "5 Sub Scenarios"

4) Again Under "Test" created "Scenario3 " (child 3)
Under "Scenario3 " recorded "2 Sub Scenarios"

Even the child has got its sub children.

After recording from the website in the _setValue the textbox value will be _setValue(_textbox(14), "User1");"
_setValue(_textbox(15), "User2");
_setValue(_textbox(16), "User3");
for one child,

_setValue(_textbox(34), "User1");"
_setValue(_textbox(35), "User2");
_setValue(_textbox(36), "User3");
_setValue(_textbox(36), "User3");
for another child,

and so on,

Here the position of the textbox blocking me in inserting the values within the box. How many numbers in the _textbox need to be incremented between the scenarios, subchilds, etc?

Error Log:

_click(_span("Scenario")); at 24 Oct, 2011 3:42:26 PM
_click(_span("Scenario[1]")); at 24 Oct, 2011 3:42:27 PM
_setValue(_textbox(1), "Test2"); at 24 Oct, 2011 3:42:27 PM
_setValue(_textbox(131), "Test2");
Error: The first parameter passed to _setValue was not found on the browser at 24 Oct, 2011 3:42:37 PM

Click for browser script at 24 Oct, 2011 2:46:09 PM

Comments

  • Hi Harsha,

    Sahi identifies the elements by their id,index,text,className. You can try using Regular Expression for the textbox whose id's are dynamic.

    You can try using _near() API to identify the elements.

    For more details about the UI Relations:

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

    Regards
    Sumitra
Sign In or Register to comment.