Whats wrong with this c# code?

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
MouseButtonEvent.Click, project.Variables["xjavavarset"].Value, project.Variables["yjavavarset"].Value)

I was trying to replace the numbers of the coordinates with variables from get commands. I placed both gets into set varbles.

Still when i try and run now i get errors thru the whole tempalte, no step will run.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
ehhh.
what you try to achieve?

First of all variables are stringe. you need ints here

Convert.ToInt32(project.Variables["xjavavarset"].Value)
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
I just want to get x and y coordinates of the upload file button for mouse click

here is the full code. How to add the get commands for x and y into mouse coordinates please?

Код:
lock (SyncObjects.InputSyncer)
{   
    // click hello button
    Emulator.ActiveWindow(instance.FormTitle);
    Emulator.MouseClick(instance.ActiveTab.Handle, MouseButton.Left, MouseButtonEvent.Click, Convert.ToInt32(project.Variables["xjavavarset"].Value), Convert.ToInt32(project.Variables["xjavavarset"].Value);
    string dialogCaption = project.Variables["caption"].Value;
    string fileToUpload = project.Variables["fileToUpload"].Value;
    System.Threading.Thread.Sleep(2000);
    // activate dialog
    Emulator.ActiveWindow(dialogCaption, true);
    System.Threading.Thread.Sleep(1000);
    System.Windows.Forms.SendKeys.SendWait(fileToUpload+"{ENTER}");
}
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
Emulation.Emulator.SendText(dialogCaption, 235, 110, "\""+fileToUpload+"\"', true); //find manualy x y
Emulator.ButtonClick(dialogCaption, "Open", true); //clicks on button named "Open"
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
^no idea where to put that, why not explain fully? I know nothing about c# the syntax etc. it just fials agian when i tried to copy and paste it in...
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Can anyone explain this to me please.

I still have no idea how to put in my own variables into c# code because whenever i try i get errors.

I just want to add mouse click with get coordinates. Anyone can make an example for me pretty please? I guess the problem is the get coordinates would change depending on template but maybe give me a simple example like on google search click button then i can extrapolate to my template.
 

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