18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
setValue not working properly with IE9
Hi,
I am attempting to set the value of a textbox. Instead of setting the value that I input, it is changing the value to ''. I am testing with the latest Sahi Version (Build: 2011-07-19), IE9 on a Windows 7 Machine.
On the page that I am attempting to use _setValue, their are multiple textboxes. Some are actually drop-down boxes that show up as _textbox("input1") in the Sahi conroller when I hold control and hover over them. The only options available are 'enabled' or 'disabled'. When I issue the command: _setValue(_textbox("input1"), "enabled");, it sets the textbox equal to ''.
On the same page, I am able to successfully use _setValue on actual textboxes - ones that are not really drop-down boxes
I have also tried _textbox("input1").value = "enabled";. This works correctly when issued in the 'Evaluate expression' area of the 'Record' tab in the Sahi Controller. However this fails when attempting to play back a Sahi script with only that 1 line. Error is TypeError: Cannot set property value that has only a getter
Any help would be greatly appreciated. Thank you!
I am attempting to set the value of a textbox. Instead of setting the value that I input, it is changing the value to ''. I am testing with the latest Sahi Version (Build: 2011-07-19), IE9 on a Windows 7 Machine.
On the page that I am attempting to use _setValue, their are multiple textboxes. Some are actually drop-down boxes that show up as _textbox("input1") in the Sahi conroller when I hold control and hover over them. The only options available are 'enabled' or 'disabled'. When I issue the command: _setValue(_textbox("input1"), "enabled");, it sets the textbox equal to ''.
On the same page, I am able to successfully use _setValue on actual textboxes - ones that are not really drop-down boxes
I have also tried _textbox("input1").value = "enabled";. This works correctly when issued in the 'Evaluate expression' area of the 'Record' tab in the Sahi Controller. However this fails when attempting to play back a Sahi script with only that 1 line. Error is TypeError: Cannot set property value that has only a getter
Any help would be greatly appreciated. Thank you!
This discussion has been closed.
Comments
Could you please post the URL of your application?
Can you please try setting a value on the other browser and check if you are able to set the value.
Regards
Sumitra
I have a page with two textboxes, in fact one is a password control. Once the page is loaded I run the following script:
_setValue(_textbox("content_minimal:login:username"), "Administrator");
_setValue(_password("content_minimal:login:password"), "password1");
Only the username textbox value is set. The password textbox value is cleared.
After further testing I discovered that this is dependent on which control has focus. On page load the username textbox has focus by default, so I changed this so the password textbox had focus on load. This resulted in SAHI script only setting the password textbox value and clearing the username textbox.
Maybe something similar to this topic:
sahi.co.in /forums/ viewtopic.php? id=2578
Regards,
Paul
You can use the following:
_focus(_textbox("content_minimal:login:username"));
_setValue(_textbox("content_minimal:login:username"), "Administrator");
_focus(_password("content_minimal:login:password"));
_setValue(_password("content_minimal:login:password"), "password1");
Check if this solves your issue.
Regards
Sumitra
Thanks that worked, is there another way though?
It would take a considerable amount of time for me to update all our scripts with a _focus() function before setting the value of a textbox.
Regards,
Paul
There is no other way.You could use _focus() API only when focus is required.
Regards
Sumitra
Thanks for your assistance.
Regards,
Paul.
No, this is not a known limitation. Scripts works fine with all the browsers no matter on what browser it is recorded.
We will have to look at the application and the source code only then we can figure out why it is not working on firefox.
If you can share the URL and the source code we would work on it and help you.
Regards
Sumitra
I have similar issue and I also use FireFox 7.0.1/ Windows 7.
this api _setValue use to work all the time before. Only now it stopped working.
This happens only with newer version of sahi. Older one works fine.
Please help.
I dont understand what you mean by the "Older one works fine".Can you please give me the build number for this.
The Firefox issue is been fixed from 2011-07-19 release . Can you use this release and check if it works fine.
If you are using version older than 2011-07-19 then you will have to use _focus() API before _setValue().
Let me know if you face any problem.
Regards
Sumitra
Your right It works in new version. sorry i think i had an old version earlier.
thanks
Keats.