终端仿真器错误中的QTP动态描述编程 [英] QTP Dynamic Descriptive Programming in Terminal Emulator Error

查看:92
本文介绍了终端仿真器错误中的QTP动态描述编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在QTP中尝试使用终端仿真器进行描述性编程(DP)。当我在静态编写脚本时,我的代码可以工作,但是当我在动态编码时,它会失败。即使在创建虚拟对象并传递其值之后,也无法检测模拟器中的字段。请帮忙。





静态描述性编程(已成功):



TeWindow(短名称:= A)。TeScreen(输入字段数:= 5)。TeField(附加文本:= USER)。设置USER

TeWindow(短名称:= A)。TeScreen(输入字段数:= 5)。TeField(附加文本:=密码)。SetSecure528ecce84d9dac2ab9ac05806f4c

TeWindow(短名称:=一个)。TeScreen(输入字段数:= 5)。SendKey TE_ENTER





动态描述性编程(失败):



设置oTeWindow = description.Create

oTeWindow(micClass)。value =TeWindow

oTeWindow(protocol)。value =5250



设置oTeScreen = description.Create

oTeScreen(micClass)。value =TeScreen

oTeScreen(输入字段数).value =5



设置oUsrEdit = description.Create

oUsrEdit(micClass)。value =TeField

oUsrEdit(附加文本)。value =User



设置oPwdEdit = description.Create

oPwdEdit(micClass)。value =TeField

oPwdEdit( 附加文本)。value =密码



TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oUsrEdit)。设置USER

TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oPwdEdit).SetSecure528ecce84d9dac2ab9ac05806f4c

TeWindow(oTeWindow).TeScreen(oTeScreen).SendKey TE_ENTER



错误信息:

找不到[TeField]对象的父[TeWindow](TeWindow类)。验证父属性是否与应用程序中当前显示的对象匹配。

行(21):TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oUsrEdit).SetUSER。

Hi,
I have tried descriptive programming(DP) in QTP using terminal emulator. My code works when I code my script in static, but it fails when I code it in dynamic. It is unable to detect the field in the emulator even if after creating a dummy object and passing its values. Please help.


Static Descriptive Programming (This works):

TeWindow("short name:= A").TeScreen("input field count:=5").TeField("attached text:=USER").Set "USER"
TeWindow("short name:= A").TeScreen("input field count:=5").TeField("attached text:=Password").SetSecure "528ecce84d9dac2ab9ac05806f4c"
TeWindow("short name:= A").TeScreen("input field count:=5").SendKey TE_ENTER


Dynamic Descriptive Programming (This fails):

Set oTeWindow=description.Create
oTeWindow("micClass").value="TeWindow"
oTeWindow("protocol").value="5250"

Set oTeScreen=description.Create
oTeScreen("micClass").value="TeScreen"
oTeScreen("input field count").value="5"

Set oUsrEdit=description.Create
oUsrEdit("micClass").value="TeField"
oUsrEdit("attached text").value="User"

Set oPwdEdit=description.Create
oPwdEdit("micClass").value="TeField"
oPwdEdit("attached text").value="Password"

TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oUsrEdit).Set "USER"
TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oPwdEdit).SetSecure "528ecce84d9dac2ab9ac05806f4c"
TeWindow(oTeWindow).TeScreen(oTeScreen).SendKey TE_ENTER

Error message:
Cannot find the "[ TeField ]" object's parent "[ TeWindow ]" (class TeWindow). Verify that parent properties match an object currently displayed in your application.
Line (21): "TeWindow(oTeWindow).TeScreen(oTeScreen).TeField(oUsrEdit).Set "USER"".

推荐答案

找到解决方案。删除类属性值并尝试如下。

设置oTeWindow = description.Create

oTeWindow(protocol)。value =5250



设置oTeScreen = description.Create

oTeScreen(输入字段数).value =5



设置oUsrEdit = description.Create

oUsrEdit(附加文本)。value =用户



设置oPwdEdit = description .Create

oPwdEdit(附加文字)。value =密码
Found Solution for this . Remove class property value and try as below.
Set oTeWindow=description.Create
oTeWindow("protocol").value="5250"

Set oTeScreen=description.Create
oTeScreen("input field count").value="5"

Set oUsrEdit=description.Create
oUsrEdit("attached text").value="User"

Set oPwdEdit=description.Create
oPwdEdit("attached text").value="Password"


这篇关于终端仿真器错误中的QTP动态描述编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆