1

I'm working now in QTP to test un website. There is a text input area that accepts 160 charactors. When using QTP to input a long text, it doesn't regard the limit and all the charactors are displayed in the area. Also, there is a message beside the area to notify the number of charactors remained and this number never changed after the input by QTP.

So I'd like to know if someone has already worked on this issue and can give me some advices. Thanks a lot in advance.

Allen

allenzzzxd
  • 331
  • 1
  • 10
  • 24

2 Answers2

1

The default record/playback mechanism is likely setting the text property of the text field directly, rather than simulating user input with the keyboard.

If your test revolves around verifying that a user cannot enter more than 160 chars in that field, you will need to tweak the QTP script to simulate keystrokes instead. You will want to use the Type method on the text field.

Tom E
  • 2,519
  • 2
  • 17
  • 22
1

As Tom said the cause for this is probably that QTP is setting the value directly, however a WebEdit doesn't support Type so you must try something else.

In order to have QTP simulate user actions more precisely you can try switching to device replay mode (as described in my answer here)

Setting.WebPackage("ReplayType") = 2 ' device replay
Browser(X).Page(Y).WebEdit(Z).Set "Some text"
Setting.WebPackage("ReplayType") = 1 ' return to event replay
Community
  • 1
  • 1
Motti
  • 110,860
  • 49
  • 189
  • 262