psexec command to invoke Autoit file- uploading a file

854 views
Skip to first unread message

Soujanya R

unread,
Jul 17, 2012, 2:04:16 PM7/17/12
to webd...@googlegroups.com
Hi,

I am trying to run psexec command to invoke Autoit script in c# webdriver.

Below part of script works fine if i run the script in remote machine from my local machine but when i run the same script through Bamboo it(GUI-browser pop up window opens and then stuck) is getting stuck at executing psexec command. 

Note: I placed psexec.exe file in Bamboo server Windows folder.

Environment/Tools Used - Firefox, c# webdriver , Autoit, psexec

new Actions(driver).MoveToElement(uploadButton).Perform();
ILocatable loc = (ILocatable)uploadButton;
IMouse mouse = ((IHasInputDevices)driver).Mouse;
mouse.MouseDown(loc.Coordinates);
mouse.MouseUp(loc.Coordinates);
Thread.Sleep(1000);
//Upload a file
var procStartInfo=new System.Diagnostics.ProcessStartInfo("C:\\Windows\\psexec.exe");
procStartInfo.Arguments="\\\\.....-vm -i 2 -w c:\\webdriver cmd.exe /c c:\\webdriver\\upload.exe c:\\webdriver\\Testfiles\\.....test.xml >NUL";
var proc = new System.Diagnostics.Process { StartInfo = procStartInfo };
proc.Start();

Please provide your ideas/suggestions to execute it through Bamboo successfully.

Thanks
Soujanya

Naresh

unread,
Jul 18, 2012, 3:38:58 AM7/18/12
to webd...@googlegroups.com
Hello Soujanya,

When you running PsExec through Bamboo, is it still run under the same account as when you were running from your machine.

When we running PsExec for first time use, it expects to accept the license agreement. If it is the case you may need to run PsExec silently.

Can you please append '/accepteula' to your PsExec arguments.

Thanks,
Naresh

Soujanya R

unread,
Jul 18, 2012, 9:52:35 AM7/18/12
to webd...@googlegroups.com
Thanks Naresh for reply! I tried /accepteula too still no use...and i am not sure if user id is still 2 or something else when it runs from Bamboo.
->Below is my bat script
cd\
psexec /accepteula \\xxxxx-vm -i 2 -w c:\webdriver cmd.exe /c c:\webdriver\upload.exe c:\webdriver\xxxfiles\autovalidxxxx182.xml >NUL


--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/C3DIVeapvucJ.

To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Naresh

unread,
Jul 18, 2012, 10:00:29 AM7/18/12
to webd...@googlegroups.com
Hello Soujanya,

You can run psexec under a specific account. You can include user name and password like this.

/accepteula -u <user name> -p <password>

And in your command, /acceptula should be after the machine name. Not before the machine name.

Thanks,
Naresh
cd\
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

Soujanya R

unread,
Jul 18, 2012, 10:17:20 AM7/18/12
to webd...@googlegroups.com
Still not working. As the password is secure i don't want to mention in scripts.Any way it is my virtual m/c which has same username and pwd of local machine on same domain.

I updated like below and tried-
psexec \\xxxxxxx-vm /accepteula -i 2 -w c:\webdriver cmd.exe /c c:\webdriver\upload.exe c:\webdriver\xxxfiles\autovalidxxxxxsets182.xml >NUL

webdriver script-
var procStartInfo = new System.Diagnostics.ProcessStartInfo(@"c:\Bamboo\psfile.bat");
var proc = new System.Diagnostics.Process { StartInfo = procStartInfo };
proc.Start();

Thanks
Soujanya


To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/Qo0Fz8Nt1Z4J.

To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.

Soujanya R

unread,
Jul 18, 2012, 4:57:40 PM7/18/12
to webd...@googlegroups.com
It is working fine now after i gave remote machine credentials in psexec command and making sure that psexec is running in Bamboo server.
 
Thanks
Soujanya

Reply all
Reply to author
Forward
0 new messages