Sign in to follow this  
Followers 0
nayaksrinivasv

Problems in Running Autoit process using VNC

3 posts in this topic

Hello Everyone,

Hope this forum can help me,

We are running a process in a remote machine with AutoIt and using VNC viewer to login to that machine.

The application that we are using requires the authentication window with the username and password textboxes to be filled and then a button should be clicked to open that application

After we send the username and password, then the window loses focus and the button is not being clicked.

We use control focus to get the focus of the button.

So we tried using winactivate before getting the focus of the button and before the pressing the button, again we passed winactivate.

Now the username is split up and half of it is sent into the username textbox and other half into the password textbox.

Can anyone give your suggestions on this issue.

Thanks and regards,

Srinivas

Share this post


Link to post
Share on other sites



Hello Everyone,

Hope this forum can help me,

We are running a process in a remote machine with AutoIt and using VNC viewer to login to that machine.

The application that we are using requires the authentication window with the username and password textboxes to be filled and then a button should be clicked to open that application

After we send the username and password, then the window loses focus and the button is not being clicked.

We use control focus to get the focus of the button.

So we tried using winactivate before getting the focus of the button and before the pressing the button, again we passed winactivate.

Now the username is split up and half of it is sent into the username textbox and other half into the password textbox.

Can anyone give your suggestions on this issue.

Thanks and regards,

Srinivas

Welcome to the forums Srinivas.

Question: are you running the AutoIt script from the remote machine once you're logged on with VNC?

Or are you running the AutoIt script on the local machine and trying to interact with the remote program by having AutoIt send commands through the VNC session window?

Can you post any code of what you've tried so far?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Welcome to the forums Srinivas.

Question: are you running the AutoIt script from the remote machine once you're logged on with VNC?

Or are you running the AutoIt script on the local machine and trying to interact with the remote program by having AutoIt send commands through the VNC session window?

Can you post any code of what you've tried so far?

Thanks for the reply...

We are running the autoit scripts on the remote machines and viewing it through VNC viewer.

We think that the network issue is preventing us from achieving what we expect and hence we are using some sleep commands also.

Any suggestions on that is also welcome.

The following is the code snippet:

If WinExists($sWindowName) = 0 Then

sleep(3000)

EndIf

If WinActive($sWindowName) = 0 Then

WinActivate($sWindowName)

EndIf

Sleep(2000)

dim $varLoginUserId = IniRead($INI_File, "LOGININFO", "LOGIN_USERID", "NotFound")

dim $varLoginPassword = IniRead($INI_File, "LOGININFO", "LOGIN_PASSWORD", "Not Found")

WinWait($sWindowName, "", 2)

_WinAPI_ShowCursor(True)

ControlFocus($sWindowName, "", "[CLASSNN:Edit1]")

ControlSend ( $sWindowName, "", "[CLASSNN:Edit1]", $varLoginUserId)

Sleep(1000)

ControlFocus($sWindowName, "", "[CLASSNN:Edit2]")

WinWait($sWindowName, "", 1)

ControlSend ( $sWindowName, "", "[CLASSNN:Edit2]", $varLoginPassword)

WinWait($sWindowName, "", 2)

Send("{TAB}")

If $CMDLINE[0] = 4 Then

$name1 = $CMDLINE[1]

$name2 = $CMDLINE[2]

$name3 = $CMDLINE[3]

$name4= $CMDLINE[4]

EndIf

dim $varxxx = IniRead($INI_File, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_File, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_File, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_File, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_FILE, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_FILE, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_FILE, "SETTINGS", "xxx", "NotFound")

dim $varxxx = IniRead($INI_FILE, "SETTINGS", "xxx", "NotFound")

dim $varxxx= IniRead($INI_FILE, "SETTINGS", "xxx", "NotFound")

dim $Name = 0

If $name2 == $xxx Then

$Name = $varxxx

Send("+{DOWN " & $Name & "}")

ElseIf $name2 == $xxx Then

$Name = $varxxx

Send("+{DOWN " & $Name & "}")

<some more similar conditions>

EndIf

WinActivate($sWindowName)

ControlFocus($sWindowName, "", "Button1")

WinActivate($sWindowName)

Send("{SPACE}")

Thanks and Regards'

Srinivas.

Edited by nayaksrinivasv

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0