VUGen с протоколом SAPGUI

Это первый раз, когда я использовал протокол SAPGUI с VUGen. Я записал скрипт в VUGen, используя протокол SAPGUI. Процесс, который я записал, - это VA01 "Создание заказа клиента". При воспроизведении скрипта я получаю ошибки ниже, не открывая sap logon:

Ошибка: строка 2 содержит 8 столбцов вместо 6 Ошибка: невозможно открыть таблицу "C:\Users\ Администратор \Documents\VuGen\Scripts\VA01\data_1.dat". Код ошибки: "-4". Предупреждение: расширение parameng.dll сообщает об ошибке -4 при вызове функции ExtPerProcessInitialize Ошибка: Контекст потока: сбой вызова службы драйвера, причина - контекст потока не был инициализирован в этом потоке.

1 ответ

Я попытался записать процесс "VA01 - Создание заказа на продажу" и смог успешно воспроизвести его.

Я использую SAP 7.40 и VuGen 12.55.

Не могли бы вы опубликовать сценарий, который вы записали?

Кроме того, вы можете просмотреть сценарий, который я записал здесь: https://pastebin.com/DkFD8W5J

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;

}

Другие вопросы по тегам