AutoIt for Windows Authentication

1,552 views
Skip to first unread message

Mohammed Sikander

unread,
Feb 1, 2011, 1:57:37 AM2/1/11
to seleniu...@googlegroups.com
Hi,

I am trying to execute AutoIt script for Windows authentication dialogue. But it is not executing when i login to the site, please let me know what i am doing wrong.

here is the AutoIt script:
AutoItSetOption("WinTitleMatchMode","2")
if $CmdLine[0] < 3 then
msgbox(0,"Error","Supply all the Arguments, Dialog title User Name, Password")
Exit
EndIf
 
WinWait($CmdLine[1]) ; match the window with substring
$title = WinGetTitle($CmdLine[1]) ; retrives whole window title
ControlSend($title,"","sikander",$CmdLine[2]);Sets User Name
ControlSend($title,"","sikander",$CmdLine[3]);Sets Password
ControlClick($title,"","OK");
Reference: http://qtp-help.blogspot.com/search/label/dialogs%20box

and here is the Selenium script:
selenium.open("URL");
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("C:\\Save_Dialog_IE.au3");

I am getting time out exception....

-Sikander


Mohammed Sikander

unread,
Feb 2, 2011, 3:18:48 AM2/2/11
to seleniu...@googlegroups.com
Hi, Could any look into this??

srinu vasu

unread,
Feb 2, 2011, 7:48:06 AM2/2/11
to seleniu...@googlegroups.com
Hi,

Can u try the attached file code....

Regards,
Srinivas

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Assessor.au3

Mohammed Sikander

unread,
Feb 3, 2011, 12:21:27 AM2/3/11
to seleniu...@googlegroups.com
No, not able to find the solution with this. Where you are passing username/password in the script?
I am attaching the screen shot here, please look into this.
authentication.JPG

srinu vasu

unread,
Feb 3, 2011, 1:18:47 AM2/3/11
to seleniu...@googlegroups.com
can u try on mozilla?

Mohammed Sikander

unread,
Feb 3, 2011, 1:40:27 AM2/3/11
to seleniu...@googlegroups.com
Manually i able to execute this script for Firefox browser, but when i am calling it from the test method it is not executing.

    @Test
    public void createProductionFolder() throws IOException{

        selenium.open("URL");
        Runtime rt = Runtime.getRuntime();
        Process pr = rt.exec("C:\\Assessor.au3");

srinu vasu

unread,
Feb 3, 2011, 1:45:56 AM2/3/11
to seleniu...@googlegroups.com
can u try in this way:

 String[] commands = new String[]{}; 
         commands = new String[]{"D:\\srinivas\\Vasu\\AutoIT\\Files\\Assessor.exe"};
 //{"C:\\Documents and Settings\\rajani\\Desktop\\Assessor.exe"}; //location of the autoit executable
        
             Runtime.getRuntime().exec(commands); 
       } catch (IOException e) {}

Regards,
Srinivas

PIYUSH MAVANI

unread,
Feb 3, 2011, 1:54:40 AM2/3/11
to seleniu...@googlegroups.com
Hi,

Do you see an icon of AutoIt in system tray when the autoit script is invoked?

Most probably it won't appear. The reason is that .au3 is not an executable file. You first need to compile it to an exe and then invoke the exe in you selenium script.

To make an exe, open the AutoIt script in scite editor and press F7. It will create the exe in same folder as your .au3 file.

Let me know if this helped....

Mohammed Sikander

unread,
Feb 3, 2011, 4:48:56 AM2/3/11
to seleniu...@googlegroups.com
I compiled the AutoIT script and executed manually, it is working perfect.

But, when i am calling the same script, it is not running.

selenium.open(URL);

String[] commands = new String[]{};
commands = new String[]{"C:\\Assessor.au3"};
Runtime.getRuntime().exec(commands);

Is something blocking to execute this?

PIYUSH MAVANI

unread,
Feb 20, 2011, 4:01:08 AM2/20/11
to seleniu...@googlegroups.com
The problem is that ".au3" files are not executable. When you double click them, a runtime is invoked to execute your script. to convert this script into an executable, open it in SCITE editor that is installed along with autoit package. Hit 'F7' on your keyboard to compile the script. Invoke the 'exe' in your selenium script rather than the '.au3' file.

Hope this helps...

BillR

unread,
Feb 22, 2011, 2:11:28 PM2/22/11
to Selenium Users
Runtime.exec() returns a Process. Normally one manages the Process by
reading stdin and stdout from it and using waitFor() to wait for
completion. Not sure if it 'just works' if you don't do these things.

On Feb 3, 1:48 am, Mohammed Sikander <sikander.qure...@gmail.com>
wrote:
> I compiled the AutoIT script and executed manually, it is working perfect.
>
> But, when i am calling the same script, it is not running.
>
> selenium.open(URL);
> String[] commands = new String[]{};
> commands = new String[]{"C:\\Assessor.au3"};
> Runtime.getRuntime().exec(commands);
>
> Is something blocking to execute this?
>
> On 3 February 2011 12:24, PIYUSH MAVANI <piyush....@gmail.com> wrote:
>
>
>
> > Hi,
>
> > Do you see an icon of AutoIt in system tray when the autoit script is
> > invoked?
>
> > Most probably it won't appear. The reason is that .au3 is not an executable
> > file. You first need to compile it to an exe and then invoke the exe in you
> > selenium script.
>
> > To make an exe, open the AutoIt script in scite editor and press F7. It
> > will create the exe in same folder as your .au3 file.
>
> > Let me know if this helped....
>
> >>>>> On 2 February 2011 18:18, srinu vasu <srinivas.a...@gmail.com> wrote:
>
> >>>>>> Hi,
>
> >>>>>> Can u try the attached file code....
>
> >>>>>> Regards,
> >>>>>> Srinivas
>
> >>>>>> On Wed, Feb 2, 2011 at 1:48 PM, Mohammed Sikander <
> >>>>>> sikander.qure...@gmail.com> wrote:
>
> >>>>>>> Hi, Could any look into this??
>
> >>>>>>> On 1 February 2011 12:27, Mohammed Sikander <
> >>>>>>> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >>>>>>> .
> >>>>>>> For more options, visit this group at
> >>>>>>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>>>>>  --
> >>>>>> You received this message because you are subscribed to the Google
> >>>>>> Groups "Selenium Users" group.
> >>>>>> To post to this group, send email to seleniu...@googlegroups.com.
> >>>>>> To unsubscribe from this group, send email to
> >>>>>> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >>>>>> .
> >>>>>> For more options, visit this group at
> >>>>>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>>>>  --
> >>>>> You received this message because you are subscribed to the Google
> >>>>> Groups "Selenium Users" group.
> >>>>> To post to this group, send email to seleniu...@googlegroups.com.
> >>>>> To unsubscribe from this group, send email to
> >>>>> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >>>>> .
> >>>>> For more options, visit this group at
> >>>>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>>>  --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Selenium Users" group.
> >>>> To post to this group, send email to seleniu...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to
> >>>> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >>>> .
> >>>> For more options, visit this group at
> >>>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>>  --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Selenium Users" group.
> >>> To post to this group, send email to seleniu...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "Selenium Users" group.
> >> To post to this group, send email to seleniu...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/selenium-users?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/selenium-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

BillR

unread,
Feb 23, 2011, 3:58:57 PM2/23/11
to Selenium Users
I.e. you may get some useful error info from the Process. Perhaps
saying 'not executable'.
> > >http://groups.google.com/group/selenium-users?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

bhaskar kumar

unread,
Feb 24, 2011, 3:06:25 AM2/24/11
to seleniu...@googlegroups.com
Hi all,

I am want to record using AUTO-IT. could you please help me how to do by using autoIT tool.

Thanks in advance.
--

Bhaskar Kumar CH
************************************************************************ ******************
Give thousand chances to your enemy to become your friend......
But don't give a single chance to your friend to become your enemy .....Unknown Author

************************************************************************ ******************   


To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages