首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有SAPGUI协议的VUGen

带有SAPGUI协议的VUGen
EN

Stack Overflow用户
提问于 2016-11-17 09:01:45
回答 1查看 675关注 0票数 0

这是我第一次在VUGen中使用SAPGUI协议。我使用SAPGUI协议在VUGen中录制了一个脚本。我记录的过程是VA01“创建销售订单”。在重放脚本时,我在没有打开sap登录的情况下直接得到下面的错误:

错误:第2行包含8列,而不是6条错误:无法打开表'C:\Users\Administrator\Documents\VuGen\Scripts\VA01\data_1.dat‘。错误代码是'-4‘。警告:扩展parameng.dll报告错误-4调用函数ExtPerProcessInitialize错误:线程上下文:调用驱动程序的服务失败,原因-线程上下文没有在这个线程上初始化。

EN

回答 1

Stack Overflow用户

发布于 2017-11-13 08:52:37

我已经尝试了录制"VA01 -创建销售订单“的过程,并能够成功地重放它。

我正在使用SAP7.40和VuGen 12.55。

你能把你录下来的剧本寄出去吗?

此外,您还可以查看我在这里录制的脚本:https://pastebin.com/DkFD8W5J

代码语言:javascript
复制
Action()
{

sapgui_open_connection_ex(connection_string1, 
    "", 
    "con[0]");

sapgui_select_active_connection("con[0]");

sapgui_select_active_session("ses[0]");

sapgui_select_active_window("wnd[0]");

sapgui_window_resize("149", 
    "25", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui104", 
    END_OPTIONAL);

/*Before running script, enter password in place of asterisks in logon function*/

lr_think_time(4);

sapgui_logon("NWBCUSER", 
    "mercury", 
    "800", 
    "EN", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1012", 
    END_OPTIONAL);

sapgui_tree_set_selected_node("VA01 - Create Sales Order", 
    shell1, 
    "F00003", 
    BEGIN_OPTIONAL, 
        "AdditionalNodeInfo=Favorites;VA01 - Create Sales Order", 
        "AdditionalInfo=sapgui1013", 
    END_OPTIONAL);

sapgui_tree_double_click_node("VA01 - Create Sales Order", 
    shell1, 
    "F00003", 
    BEGIN_OPTIONAL, 
        "AdditionalNodeInfo=Favorites;VA01 - Create Sales Order", 
        "AdditionalInfo=sapgui1014", 
    END_OPTIONAL);

lr_think_time(4);

sapgui_set_text("VBAK-AUART", 
    "12", 
    ctxtVBAK1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1017", 
    END_OPTIONAL);

sapgui_set_text("Sales Organization", 
    "ss", 
    ctxtVBAK2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1018", 
    END_OPTIONAL);

sapgui_set_focus(ctxtVBAK2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1019", 
    END_OPTIONAL);

sapgui_send_vkey(F4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1021", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_window_scroll_to_row("0", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1025", 
    END_OPTIONAL);

sapgui_set_focus(lbl1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1024", 
    END_OPTIONAL);

sapgui_send_vkey(F2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1028", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_set_focus(ctxtVBAK3, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1031", 
    END_OPTIONAL);

sapgui_send_vkey(F4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1033", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_window_scroll_to_row("0", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1037", 
    END_OPTIONAL);

sapgui_set_focus(lbl2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1036", 
    END_OPTIONAL);

sapgui_send_vkey(F2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1040", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_set_focus(ctxtVBAK4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1043", 
    END_OPTIONAL);

sapgui_send_vkey(F4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1045", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_window_scroll_to_row("0", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1049", 
    END_OPTIONAL);

sapgui_set_focus(lbl3, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1048", 
    END_OPTIONAL);

sapgui_send_vkey(F2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1052", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_set_focus(ctxtVBAK5, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1055", 
    END_OPTIONAL);

sapgui_send_vkey(F4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1057", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_press_button("Continue   (Enter)", 
    btn1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1060", 
    END_OPTIONAL);

sapgui_press_button("Continue   (Enter)", 
    btn1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1063", 
    END_OPTIONAL);

sapgui_set_focus(ctxtG_SELFLD_TAB1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1066", 
    END_OPTIONAL);

sapgui_send_vkey(F2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1068", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[2]");

sapgui_window_close(
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1071", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_set_focus(txtG_SELFLD_TAB1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1074", 
    END_OPTIONAL);

sapgui_send_vkey(F2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1076", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[2]");

sapgui_grid_select_cell("'Sales Office' (2, Description)", 
    shell2, 
    "2", 
    "TEXT", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1079", 
    END_OPTIONAL);

sapgui_grid_select_rows("'Sales Office', 2", 
    shell2, 
    "2", 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1080", 
    END_OPTIONAL);

sapgui_grid_double_click_current_cell("'Sales Office' (2, Description)", 
    shell2, 
    BEGIN_OPTIONAL, 
        "CurrentRow=2", 
        "CurrentCell=TEXT", 
        "AdditionalInfo=sapgui1081", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_set_focus(txtG_SELFLD_TAB1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1084", 
    END_OPTIONAL);

sapgui_press_button("Cancel   (F12)", 
    btn2, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1086", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_send_vkey(F4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1089", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_window_close(
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1092", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_status_bar_get_text("paramStatusBarText", 
    BEGIN_OPTIONAL, 
        "Recorded status bar text: Choose a valid function", 
        "AdditionalInfo=sapgui1097", 
    END_OPTIONAL);

lr_think_time(6);

sapgui_set_text("Sales Office", 
    "1", 
    ctxtVBAK5, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1098", 
    END_OPTIONAL);

sapgui_set_text("Sales Group", 
    "2", 
    ctxtVBAK6, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui1099", 
    END_OPTIONAL);

sapgui_set_focus(ctxtVBAK6, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui10100", 
    END_OPTIONAL);

sapgui_press_button("Back   (F3)", 
    btn3, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui10102", 
    END_OPTIONAL);

sapgui_press_button("Log off   (Shift+F3)", 
    btn4, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui10105", 
    END_OPTIONAL);

sapgui_select_active_window("wnd[1]");

sapgui_press_button("Yes", 
    btnSPOP1, 
    BEGIN_OPTIONAL, 
        "AdditionalInfo=sapgui10108", 
    END_OPTIONAL);

return 0;

}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40650536

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档