Select + Keyboard Emulation Code Help

shThs

Пользователь
Регистрация
03.10.2018
Сообщения
117
Благодарностей
3
Баллы
18
Hi,

I am using the Set value from profile to select a city from a drop down. However, the drop-down requires the user to execute the Enter key on a keyboard to make the selection. The ZM tools allows me to create the Selection emulation and the keystroke emulation, but no ability to combine both in the same action. The only way to execute this is to create a C+ code I presume.

This is what I have so far:

// Action designer, type Set
HtmlElement he = instance.ActiveTab.GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildById("7ec089f3-7b35-4570-bea4-eb01f28b810e");
if (he.IsVoid) return -1;

// Emulation delay
instance.WaitFieldEmulationDelay();
// Set element value "project.Profile.Town"
he.SetValue(project.Profile.Town, instance.EmulationLevel, true);
instance.WaitFieldEmulationDelay();
// Emulate text entering
instance.SendText("Enter", 15);

This isn't working properly as I am not making the correct argument to make the bot execute the Enter key keystroke after it makes a random selection. Can someone please assist me in fixing the code above?

Thank you in advance.
 

SShkolin

Новичок
Регистрация
08.09.2020
Сообщения
1
Благодарностей
0
Баллы
1

Обращаем Ваше внимание на то, что данный пользователь заблокирован.
Не рекомендуем проводить с SShkolin какие-либо сделки.

never mind
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)