Najtssob Posted April 5, 2011 Share Posted April 5, 2011 (edited) Hi, I need to automate some login procedure (nothing important, so there is really no scurity issues). How can I enter username and password into apropriate field ? I tried to modify calculator.au3 example, but the script always complete just one field. Best regards, Najtssob. Edited April 5, 2011 by Najtssob Link to comment Share on other sites More sharing options...
bogQ Posted April 5, 2011 Share Posted April 5, 2011 Post the modifyed script Send("Username") Send("{TAB}");<= to change to some other field Send("Password") Some other way is using ControlSend(), with using autoit window info tool to get control ID 013setf 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Najtssob Posted April 12, 2011 Author Share Posted April 12, 2011 Thank you very much. How can I check if username field is empty and if isn't how can I cleare it ? Because now is the problem that the app remebers the previous username and when my script enter new username it appends it at the end. Best regards, Najtssob. Link to comment Share on other sites More sharing options...
bogQ Posted April 12, 2011 Share Posted April 12, 2011 Apart from ControlSend, you can also try to use ControlSetText to try to change existing text or ControlGetText to check if you can read text in that field. Look in the help file in Index for all Control* commands to see the full list of the commands that you can try to use or test. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Najtssob Posted April 14, 2011 Author Share Posted April 14, 2011 Thank you again. I have few more questions, If you can help me. 1. How to hide form/window until the user is logged in and desktop is ready. If I use this command at start Run("C:\Program Files\VMware\VMware View\Client\bin\wswc.exe", @SW_HIDE) and WinSetState("VMware View Client", "", @SW_SHOWDEFAULT) at the end, then the application doesn't work. I see it's process in task manager, but nothing showes up on the screen. 2. How can I replace this "Sleep(3000)" commands with something more reliable? Problem is that after each "phase" a window/form is closed and after few second a new window/form is shown with same title but different content. How it looks if you connect manualy: First you enter server name an press enter, after that form dissapers and few seconds later new form opens where you enter username and password. Then again you press enter and form dissapears and again in few seconds new form opens with some additional setings. You press enter for the third time and the fourth and final window with your desktop opens. I would like that first three forms would be invisible and only fourth form/window should be shown. All this four forms have title "VMware View Client" and in task manager is al the time process wswc.exe. Here is my code so far. ; Run the VMware View Run("C:\Program Files\VMware\VMware View\Client\bin\wswc.exe") ;PHASE ONE WinWaitActive("VMware View Client") ; Enter server name ControlSetText("VMware View Client", "", "[CLASSNN:Edit1]", "view.demo.local") Send("{ENTER}") ;PHASE TWO ; Enter username and pass Sleep(3000) WinWaitActive("VMware View Client") ControlSetText("VMware View Client", "", "[CLASSNN:Edit1]", "demo") ControlSetText("VMware View Client", "", "[CLASSNN:Edit2]", "demo123") Send("{ENTER}") ;PHASE THREE Sleep(3000) Send("{ENTER}") ;PHASE FOUR ; here a maximazide window with user desktop should be opened. Link to comment Share on other sites More sharing options...
bogQ Posted April 14, 2011 Share Posted April 14, 2011 (edited) 1) The third parametar on Run() command is show_flag, not the second as it stands in your post Run("notepad.exe","",@SW_HIDE) ToolTip("Run command,sleep 2 seconds") Sleep(2000) WinSetState("Untit","",@SW_SHOW) ToolTip("SHOW command,sleep 5 seconds before exit") Sleep(5000) 2) You have commands like WinWait WinWaitClose In some cases you can use WinGetHandle to compare windows eg. Run("notepad.exe","",@SW_SHOW) Run("notepad.exe","",@SW_SHOW) Sleep(10) ToolTip("Running 2 notepad wins, close the last open win (active win) to exit") WinWait("Untit") WinWaitClose(WinGetHandle("[ACTIVE]")) So script have handle of active win and its waiting for you to close it, it will not react if you activate some other win with identical name, only the one wih with specific handle will trigger WinWaitClose command and exit the script. Some other way is to get the handle of curent win and loop until win dont exsist $hwnd = WinGetHandle("Untit") While WinExists($hwnd) Sleep(10) WEnd There are lots of other functions that can b used for something this, but i dont think that you shud use something other thatn this three funcs to get what you need in this situation. Edited April 15, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Najtssob Posted April 18, 2011 Author Share Posted April 18, 2011 Hi It's me again I managed to overcome the second problem but the first remains. I changed first line into Run("C:\Program Files\VMware\VMware View\Client\bin\wswc.exe", "", @SW_HIDE) but the window remain visible I tried to add multiple WinSetState("VMware View Client", "", @SW_HIDE) statements, but the windows keeps poping up. I add this statement at the begining of every so called phases. Any more ideas ? P.S. If someone is willing to try it himself, I can setup a server reachable from the inernet and upload client sowhere that others can download it. Link to comment Share on other sites More sharing options...
pieeater Posted April 18, 2011 Share Posted April 18, 2011 try controlsettext :/ tht might work [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
Najtssob Posted April 19, 2011 Author Share Posted April 19, 2011 try controlsettext :/ tht might workHow can this help, with forms hidding ? Link to comment Share on other sites More sharing options...
FMS Posted April 19, 2011 Share Posted April 19, 2011 (edited) the best thing is to get to know the promt commands for vmware this is just new and u might wanna see this link: http://webwereld.nl/nieuws/106282/vmware-vanaf-de-prompt.html#utm_source=front_techworld_1&utm_medium=website&utm_campaign=ww just realized.... i hope you are dutch because the site is in dutch... iff u aren't try google vmware promt commands this commands u can put in your script;) Edited April 19, 2011 by FMS as finishing touch god created the dutch Link to comment Share on other sites More sharing options...
Najtssob Posted April 19, 2011 Author Share Posted April 19, 2011 (edited) @FMS I know prompt commands for vmware view, but this doesn't help me to hide it's form. Also I need to do a little more that you can do using romp command provided by vmware view. Thank you anyway. Edited April 19, 2011 by Najtssob Link to comment Share on other sites More sharing options...
Najtssob Posted April 30, 2011 Author Share Posted April 30, 2011 @bogQ Any more ideas how to hide form ? Link to comment Share on other sites More sharing options...
pieeater Posted April 30, 2011 Share Posted April 30, 2011 (edited) i think your forgetting to use @SW_SHOW after you use @SW_HIDE like use @SW_HIDE to hide the window you dont want to see and use @SW_SHOW on the window u want to see Edited April 30, 2011 by pieeater [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
bwochinski Posted May 1, 2011 Share Posted May 1, 2011 Any more ideas how to hide form ?Could you post all your code, as it is now with the WinSetState() lines included? Link to comment Share on other sites More sharing options...
bogQ Posted May 1, 2011 Share Posted May 1, 2011 @bogQAny more ideas how to hide form ?To tell you the truth, i don`t have VMware (i use only VirtualPC) so i cant test or confirm the problem with hiding the win, and i don`t know how the win reacts.If i was you and WinSetState("VMware View Client", "", @SW_HIDE) failed i would try_WinAPI_SetParent ( WinGetHandle ( "winname" ),$HandleToAutoitCreatedGui )to put win in a autoit win and instead hiding main win with WinSetState to hide autoit created guiGUISetState ( @SW_HIDE , $AutoitGui )Note that before using _WinAPI_SetParent move your VMware win to 0 0 pos with WinMoveI don`t have slitest idea how will all of that will react because i cant test it, if it don`t work and you cant _WinAPI_SetParent to that win and hide it with gui only thing in my head left is to put win to some crazy pos, like WinMove("Untitled","",2000,2000) so that user cant click it until the time is right, or to wait to someone other have some better idea. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Najtssob Posted May 1, 2011 Author Share Posted May 1, 2011 This is part of my code, modified so you can test it. ; Run the VMware View Run("C:\Program Files\VMware\VMware View\Client\bin\wswc.exe -serverURL 193.110.145.164", "", @SW_HIDE) ; Wait for the VMware View to become active Sleep(2000) ;without this, username and pass are not set WinWaitActive("VMware View Client") WinSetState("VMware View Client", "",@SW_HIDE) ControlSetText("VMware View Client", "", "[ID:1004]", "Username") ControlSetText("VMware View Client", "", "[ID:1066]", "pass") ;Send("{ENTER}") Sleep(5000) ; let us see if there is anything in edit fields. If there is, then we were sucessfull WinSetState("VMware View Client", "",@SW_SHOW) Here you can get view client https://193.110.145.164/. It's 22MB in size. Link to comment Share on other sites More sharing options...
bwochinski Posted May 1, 2011 Share Posted May 1, 2011 (edited) Well I'm not able to connect to your server from my pc, but thank you for providing a good script and the link to the VMware download. I do see somewhat what you mean, but I was able to get the window to hide with the WinSetState() function. The Run command doesn't seem to honor the show_flag parameter when set to @SW_HIDE. It'll do a @SW_MINIMIZE though. The below is the fastest I've gotten it to hide upon startup: Run("C:\Program Files\VMware\VMware View\Client\bin\wswc.exe", "", @SW_MINIMIZE) WinWait("VMware View Client") WinSetState("VMware View Client", "",@SW_HIDE) ControlSetText("VMware View Client", "", "[CLASS:Edit; INSTANCE:1]", "Server Address") Sleep(2000) WinSetState("VMware View Client", "",@SW_RESTORE) WinSetState("VMware View Client", "",@SW_SHOW) The user/pass screen wouldn't come up without connecting, so I just set the server address field to simulate the same thing. EDIT: This was tested on WinXP, can test on Vista later if need be. Edited May 1, 2011 by bwochinski Link to comment Share on other sites More sharing options...
bogQ Posted May 1, 2011 Share Posted May 1, 2011 (edited) Dono if itl work, try to run it with -userName -password parametar? Run("E:\Program Files\VMware\VMware View\Client\bin\wswc.exe -serverURL 193.110.145.164 -userName NamE -password PasS", "") wswc.exe -checkin -staycheckedout -desktopName <name of desktop> -serverURL <URL of server> -userName <name of user> -password <password> -domainName <name of domain> Edited May 1, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Najtssob Posted May 1, 2011 Author Share Posted May 1, 2011 (edited) @bogQ You can use command line parameters to input username and password for the DESKTOP. But there are no parameters for RSA username and password, so this part I wish to automate. You have two levels of authentication. First level is RSA username and pass and second level is username and pass for the desktop. Edited May 1, 2011 by Najtssob Link to comment Share on other sites More sharing options...
AKS02 Posted October 15, 2019 Share Posted October 15, 2019 On 4/5/2011 at 8:50 PM, bogQ said: Post the modifyed script Send("Username") Send("{TAB}");<= to change to some other field Send("Password") Some other way is using ControlSend(), with using autoit window info tool to get control ID I was trying this code : Send("Username") Send("{TAB}");<= to change to some other field Send("Password") this code run only once, but now it is not running successfully, getting 18:11:30 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE - *** Compile in Test mode skipping Tidy; Au3Stripper; Resource updating and Versioning to speed up the process. *** >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\user\Desktop\Hello - Copy.au3 +>18:11:30 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\user\Desktop\Hello - Copy.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>18:11:32 AutoIt3.exe ended.rc:0 +>18:11:32 AutoIt3Wrapper Finished. >Exit code: 0 Time: 2.145 Please suggest me.. On 4/5/2011 at 8:50 PM, bogQ said: Post the modifyed script Send("Username") Send("{TAB}");<= to change to some other field Send("Password") Some other way is using ControlSend(), with using autoit window info tool to get control ID Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now