本文介绍了QTP忽略输入charactors的数的限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在QTP现在正在测​​试联合国网站。有接受160 charactors的文本输入区域。当使用QTP输入长文本时,它并不认为上限和所有charactors中显示的区域。此外,还有的区域旁边一条消息,通知的数量charactors保持和由QTP输入后这个号码没有改变。

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.

阿伦

推荐答案

至于汤姆说这种情况的原因可能是QTP直接设置值,然而 WebEdit 不支持键入所以你必须尝试别的东西。

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.

为了让QTP模拟用户操作更precisely你可以尝试切换到设备回放模式(在我的)

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

这篇关于QTP忽略输入charactors的数的限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 07:37