sendVKey的屏幕角色脚本编写问题

2020-08-25 00:15发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我录制了一个简单的脚本...输入...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


我录制了一个简单的脚本...输入tcode ztradersplit,按Enter,在字段中输入" TEST",然后按F8。 录制的脚本默认情况下不起作用是有原因的吗? 我正在使用SE。...我应该使用webgui吗?

这是我的剧本:

session.findById(" wnd [0]/tbar [0]/okcd")。text ="/img/oZTRADERSPLIT";

session.findById(" wnd [0]")。sendVKey(0);

session.findById(" wnd [0]/usr/txtP_TKONEX")。text =" TEST";

session.findById(" ses [0]")。sendVKey(8);

但是当我尝试执行此脚本时,出现以下错误:session.findById(...)。sendVKey不是函数

这是我的错误日志:

脚本执行期间发生错误:TypeError:session.findById(...)。sendVKey在eval上不是一个函数([AppID:WB21]> [Flavor:WB21_2020__V2 _]> [Script:undefined-CreateTraderSplit]:9:28 )构造函数.sap.se.core.scripting.ScriptEngine._executeScriptImpl(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:1354: 49)在builder.sap.se.core.scripting.ScriptEngine.executeSingleScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:1441) :14)在Constructor.sap.se.core.scripting.ScriptEventHandler.executeScriptOnScreenEventListener(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval: 386:1538)在builder.sap.se.core.scripting.ScriptEventHandler.onExecuteScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval :386:3594)在ConstructScript.sap.se上的ExecuteScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:27:261) .core.dynp。 DynpSync.submitImpl(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:2780:12)在builder.sap.se.core.dynp .DynpSync.submitActions(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:3141:14),位于builder.sap.se.core。 InteractionHandler._doNextJob(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:388:6452)位于builder.sap.se.core.InteractionHandler ._readyForNextJob(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:388:6045)信息,2020-01-24,16:43 :23.112脚本执行期间错误:TypeError:session.findById(...)。sendVKey在eval上不是函数([AppID:WB21]> [Flavor:WB21_2020__V2 _]> [Script:undefined-CreateTraderSplit]:9:28) 在builder.sap.se.core.scripting.ScriptEngine._executeScriptImpl(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:1354:49 ),位于builder.sap.se.core.scripting.ScriptEngine.executeS ingleScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:1441:14)位于builder.sap.se.core.scripting.ScriptEventHandler .executeScriptOnScreenEventListener(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:386:1538),位于builder.sap.se.core.scripting。 ExecuteEvent(https://mysapserver:44444)上的ScriptEventHandler.onExecuteScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:386:3594) /sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:27:261),位于builder.sap.se.core.dynp.DynpSync.submitImpl(https://mysapserver: 44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:2780:12)在builder.sap.se.core.dynp.DynpSync.submitActions(https://mysapserver :44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:3141:14)在builder.sap.se.core.InteractionHandler._doNextJob(https://mysapserver: 44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:3 88:6452)的构造函数.sap.se.core.InteractionHandler._readyForNextJob(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:388 :6045)信息,2020-01-24,16:43:48.280脚本执行期间错误:TypeError:session.findById(...)。sendVKey不是eval的函数([AppID:WB21]> [Flavor:WB21_2020__V2_ ]> [Script:undefined-CreateTraderSplit]:9:28),位于builder.sap.se.core.scripting.ScriptEngine._executeScriptImpl(https://mysapserver:44444/sap/bc/se/m/script/sap/se /core/Component-preload.js?eval:1354:49),位于builder.sap.se.core.scripting.ScriptEngine.executeSingleScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload.js?eval:1441:14),位于builder.sap.se.core.scripting.ScriptEventHandler.executeScriptOnScreenEventListener(https://mysapserver:44444/sap/bc/se/m/script/sap /se/core/Component-preload.js?eval:386:1538),位于builder.sap.se.core.scripting.ScriptEventHandler.onExecuteScript(https://mysapserver:44444/sap/bc/se/m/sc ript/sap/se/core/Component-preload.js?eval:386:3594)在ExecuteScript(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component/preload .js?eval:27:261)位于builder.sap.se.core.dynp.DynpSync.submitImpl(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component- preload.js?eval:2780:12)位于builder.sap.se.core.dynp.DynpSync.submitActions(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component -preload.js?eval:3141:14)在builder.sap.se.core.InteractionHandler._doNextJob(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component- preload.js?eval:388:6452)位于builder.sap.se.core.InteractionHandler._readyForNextJob(https://mysapserver:44444/sap/bc/se/m/script/sap/se/core/Component-preload .js?eval:388:6045)

2条回答
歪着头看世界
2020-08-25 00:35

正如Elliott所说,webgui(和SE)是单个会话,因此/o将不起作用。 替换为/n

此外,如果此后仍然遇到 sendVKey 问题(以防万一,请不要这样做),然后尝试使用 press( )按钮的方法。

一周热门 更多>