2

I'm automating a web portal with Iexplorer. I am using UFT V11.50.

I'm having problems when writing to a textbox. I use the following statement:

Browser ("browser"). Page ("page"). Frame ("Calendar"). WebEdit ("_ CALCOD"). Set "5"

I use .SET to write to him textbox and it works but it is not recorded. Writes in the textbox number 5 but a second then disappears. I do not feel the same in other textbox.

I do not understand what happens to me. Can you help?

Juan Carlos Farah
  • 3,829
  • 30
  • 42
Marta79
  • 91
  • 1
  • 3
  • 14
  • Have you tried the type() function? If that doesn't work, try adding a small wait before you type in the field. – LittlePanda Apr 10 '15 at 06:08

2 Answers2

1

It may be that your edit field responds to different HTML events than UFT uses (UFT uses the most common events).

One way to work around this is to use device replay, this means that UFT will simulate a human being sitting at the keyboard and simulate the actual input device of the computer, thus the browser will fire all the events it would if a real person set the value of the edit field.

See this answer for more details about device replay mode.

Setting.WebPackage("ReplayType") = 2 ' Enter device mode

Browser("browser").Page("page").Frame("Calendar").WebEdit("_CALCOD").Set "5"

Setting.WebPackage("ReplayType") = 1 ' Return to event mode
Community
  • 1
  • 1
Motti
  • 110,860
  • 49
  • 189
  • 262
1

I finally found the solution to my problem was as follows:

Public function writeText(field) 
  Set x = Browser("browser").Page("page").Frame("Calendar").WebEdit("_CALCOD")
  x.Object.innertext=field  
End Function

field = 5

It may be that my answer is not the most optimal, but it worked.

Motti
  • 110,860
  • 49
  • 189
  • 262
Marta79
  • 91
  • 1
  • 3
  • 14