Set text on a controlled field
Hello everybody !
UFT version : 12.54, Firefox version : 37.0.1, Chrome version : 67, IE version : 11.0.9
I have an input field where I have to enter a date (format dd/mm/yyyy). When I do it manually, everything is fine. With UFT, on IE, it works with a classic "Set". On Firefox and Chrome, after leaving the field, I have the error message "The date must have the format dd/mm/yyyy" (thank you, App, that's exactly what I gave you !). I have the same problem with an email field (where the app controls the presence of "@" and ".", I guess). It's like my input on Chrome and Firefox doesn't trigger the control.
I tried :
set mySendKeys = CreateObject("WScript.shell")
set mySendKeys = nothing
Set myDeviceReplay = CreateObject("Mercury.DeviceReplay") myDeviceReplay.SendString "10/12/2018"
set myDeviceReplay = nothing
- And a customized SetDate
obj.Click obj.Set(val) Wait 0,500 MouseReplay True obj.Click -5, 5 'click outside of the field MouseReplay False
Visually I always get what I want (except with "type" that does nothing at all for me), the field if filled with "10/12/2018", but I have the error message.
When I delete manually the last number (initially written with UFT), re-write it manually and leave the field manually, it works. On Chrome if I press "TAB" or "ENTER" (manually) it doesn't leave the field, I have to click outside of the field.
I'm running out of ideas. There may be something to try with the FireEvent but I don't understand how it works.
If you have any idea, I would be happy to try it ! 🙂
Re: Set text on a controlled field
Hope that you are okay,
I was reviewing the topic that you open with us, and i understood the following:
I saw the approaches that you were trying to do, And for this case it seems that for this kind of scenario, it is something that can provide some workaround for this issue, also i saw that with some actions you are able to perform the actions but you are receiving the error "The date must have the format dd/mm/yyyy", if it is indeed performing the action, try with this code line before the steps that brings the issue:
- on error resume next ' this indicate that if error occured, UFT don't pause execution and report an error
then put the code that do the action
after that code enter, to return to the normal state of UFT
- on error goto 0 ' this will recover the error setting
That is in case that UFT with code that you have is performing the action. and only receiving the error message.
If not what i can think in the top of my head is to use the workarounds for non supported scenarios(not saiying that it is, but it might help)
UI automation: please review these links to know more about UI automation
Insight recording, low level recording, analog recording
Also i saw in other forums, some similar topics maybe you will find something useful in these links:
If i am mistaken with something feel free to correct me 😄
Hope that this helps you in some way!