WebEdit fields revert to original value
Question ID: 107986

On our web application there are some WebEdit objects. Some of these objects have default values in them when the page loads. You can change the value, but when we try to do this with UFT using .Set, the value reverts back to the original value and produces a false result.

Marked as spam
Posted by (Questions: 386, Answers: 64)
Asked on October 31, 2017 6:46 pm
Answers (1)
Private answer

There are a couple of things you can try.

First, try changing the ReplayType. ReplayType is a UFT Web Add-in setting. It can be used to change how the events are replayed on the browser. There are two modes of ReplayType:

*Event (1) - Replay of events using the Browser methods (something similar to DOM).

*Mouse (2) - Replay of events using the mouse and keyboard simulation.

Setting.WebPackage(''ReplayType'') = 2 'Mouse

Setting.WebPackage(''ReplayType'') = 1 'Event(Default)
So if you wrap your .Set code in that, it may resolve the issue.

If that does not work, try using DeviceReplay. This is similar to SendKeys (which may also work in this situation, but I have had more success with DeviceReplay). You can find details about this in Micro Focus documents [KM184330][1] and [KM1194127][2].

To use the method, .Click the WebEdit object that you want to change the value of, then use the following code:

Set DeviceReplay = CreateObject(''Mercury.DeviceReplay'')
DeviceReplay.SendString(''Your New Value'')
Set DeviceReplay = Nothing

I hope this helps.

[1]: https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM184330
[2]: https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM1194127

Marked as spam
Posted by (Questions: 16, Answers: 807)
Answered on October 31, 2017 6:48 pm
Thanks, the ReplayType method worked, but I am glad you included the information about the Device Replay as well, because I was not aware of that.
( at October 31, 2017 6:50 pm)

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

Scroll to Top