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.

Setting a value to a specific textbox

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

In my web page I have several text boxes…with the labels “Name #” , “Mid Name #”, “Last Name #”.

I am using Sahi, and in my test I want to set the port value in the first textbox “Name #” to some value, like “20”.

I am trying: textbox(0).near(browser.span("Port #")).setValue(Alex);

However, Sahi confuses the text boxes..and doesn’t know which text box do I mean… it actually tries to set the value into the “Mid Name #” text box…

Can I make the specification of my text box more exact? Like to search for the label “Name #” ?

Comments

  • NaomiCNaomiC Members
    Is it typo or what. If you want to set value to textbox near the label "Name #", the code should be @browser.textbox(0).near(@browser.label("Name #")).setValue("Alex"). Replace label with span if the label is actually a span.
Sign In or Register to comment.