AutoIt & Selenium Library

1,204 views
Skip to first unread message

antonio III cabreira

unread,
Apr 2, 2012, 10:58:29 AM4/2/12
to robotframework-users
HI All,

I am using Selenium library keywords in my test scripts. Sadly I have
to run my scripts under a proxy so for me to interact with the "ok"
button of the proxy authentication window, I tried using the AutoIt
library to click that button. So below is the code:
Set Selenium Timeout 60s
Open Browser http://www.sports.yahoo.com firefox
Wait For Active Window Authentication Required
Send {ENTER}
${browser_title} = Get Title

Now the problem is, for Robot Framework to move from the Open Browser
keyword to the Wait For Active Window, it needs to execute the Open
Browser keyword successfully. But hitting the Ok button for the
authentication to successfully load the page is displayed during the
Open Browser keyword.

Is there a way I can somehow hit the Ok button in the middle of the
Open Browser keyword?

Thanks!

David

unread,
Apr 2, 2012, 5:33:43 PM4/2/12
to robotframework-users
It's currently not working for you? I'm assuming the authentication
pops up before the URL to open in browser completely loads. But does
the authentication block Selenium(Library) open browser keyword from
completing and return (to RF test)?

If it is blocking, then your only option is to create test where you
run both commands simultaneously. I believe that isn't possible as
part of test case syntax (but could be wrong). You'd have to either:

* create AutoIt program/server that will poll for the window and hit
ok and launch this program (via Run keywords from
OperatingSystemLibrary, etc or some equivalent shell execute call) to
execute by itself in parallel while Selenium command is and not wait
for it to return a status code (return right away, while program is
still running).

* create your own keyword that will run AutoItLibrary command in
parallel but not be blocking your test, in that it will return
immediately upon call rather than wait for AutoIt keyword to complete
(and return a value).

Also, have you looked into the other various methods to supply
authentication login info through the FF profile or HTTP headers sent
from FF so that you can bypass the browser GUI login popup. Google for
them. These only work for FF browser though.

On Apr 2, 7:58 am, antonio III cabreira

tmpalaniselvam

unread,
Apr 10, 2012, 4:11:46 AM4/10/12
to robotframework-users
Hey,

Can you try the following steps?

1. For OpenBrowser step, take the URL, which will not ask any username/
password. Probably just domain name.
2. Then use AutoIT or any other libraries to enter URL and then enter
username and password...

Hope it would be helpful.


Thanks & Regards,
Palani.
http://tips-testing.blogspot.com/index.html


sandeep s

unread,
Apr 10, 2012, 4:56:08 AM4/10/12
to robotframe...@googlegroups.com

Instead of calling autoit when its needed..you can start the autoit server as a listening thread...When ever a windows based pop up is found autoit can automatically click on the OK /Cancel button and continue...
I beleive this is the same solution put in different words by David as well..

sandeep




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



Sajjad Malang

unread,
Apr 10, 2012, 5:21:50 AM4/10/12
to sand...@gmail.com, robotframe...@googlegroups.com
Hello Sandeep,


I just had to click an OK for a scurity warning on firefox that i could not disable. You could also use a similar for the proxy window.

Use the autoit script editor and create an exe and call it with start process keyword.


WinWait("Security Warning")
winactivate("Security Warning")
WinWaitActive("Security Warning")
Send("{ENTER}")

just replace "Security Warning" with the title of the proxy popup.

Regards,
\Sajjad.
--
Regards,
\Sajjad.


sandeep s

unread,
Apr 10, 2012, 5:49:16 AM4/10/12
to robotframework-users, antonio.c...@gmail.com
 :)

antonio III cabreira

unread,
Apr 11, 2012, 10:02:38 AM4/11/12
to sandeep s, robotframework-users
Thanks for your suggestions. Will post here the results of your suggestions. I had to disable the authentication for now since I ran out of options and I was being stuck at the step for sometime. Your help is appreciated. Thanks again.
Reply all
Reply to author
Forward
0 new messages