FAQ

erikvanzijst edited this page Apr 12, 2011 · 12 revisions

Q: Why does Windmill break when I navigate using the address bar?
A: Windmill uses code that lives in the content space of the browser, which means we can’t recognize that you are navigating using the address bar. To accomplish this task, create a new action in the IDE using the method ‘open’, playing that action will take you to the new site you desire, will include the action in your test, and will let the server know what you are doing so that we can make the appropriate changes for the new domain you are now testing against.

Q: Why does Windmill break when I navigate to an URL that starts with https:// ?
A: You need to run windmill with the “ssl” flag, this will enable windmill’s ssl support. See the SSL-Support page for details on how to get SSL working on various platforms.

Q: How can I find out if I’m running Windmill branch or head?
A: Do the following:

    $python 
    >>> import windmill
    >>> windmill.__file__

This will let you know where the init.pyc file is for your windmill install, e.g.
'c:\\dev\\windmill\\head\\windmill\\__init__.pyc'

Q: How do I pass variables in to my Python tests?
A: This turns out to be a very common need for dynamic tests that login to a service or need to be configurable for different test runners or configurations. If you are using Python tests, there is a very easy way to accomplish this task and it is documented in Building Tests

Q: Where should I look for information about reporting test results?
A: We have functionality available to make this easier but the formatting is a generally custom to your requirements. Mikeal Rogers wrote a great blog post outlining his solution for generating JUnit compatible output, but beyond that consult your local Python wizard or come talk to us.

Q: How to make standalone IE6 work?
A:
Note: You can not run standalone IE6 if IE7 is currently open. You MUST close all IE7 windows.

Make a file called config.py and save it to your current directory.

IE_BINARY = "C:\Program Files\iexplore.exe" 

In a command window:
set WINDMILL_CONFIG_FILE="config.py"
windmill -x shell 

Q: Why does Windmill keep resolving my requests to Mozilla live bookmarks ?
A: When the first attempt request doesn’t work, the Windmill proxy tries the other domains that look like they might be the correct destination until it finds one that works, live bookmarks returns data even though it’s not the correct destination. To stop this from happening, you can blacklist the problematic URL in the Preferences File.

Q: I moved my Firefox from it’s default installation, or I want to use a custom profile, how do I configure this ?
A: We have an advanced usage page, Advanced Topics how to use your Preferences FIle file to tell Windmill where to look for both the firefox binary to launch and the firefox profile to use. This is sometimes indicated by:

 "KeyError: 'MOZILLA_BINARY'"  

Q: What are the most prominent differences between selenium and windmill?
A: Below you will find the IRC conversation:

(11:41:10 AM) designs703: what are the most prominent differences between 
selenium and windmill?
(11:41:59 AM) mikeal: windmill supports multiple domains, has integrated 
debugging and recording, supports jQuery selectors for looking up nodes, 
supports dynamic calls from javascript back in to the authoring language
(11:42:15 AM) mikeal: includes a javascript test framework so you can 
write your tests in javascript
(11:42:20 AM) mikeal: that's most of it
(11:42:30 AM) mikeal: the next version will support Flash
(11:42:42 AM) designs703: neat
(11:42:52 AM) designs703: being able to write tests in js is pretty 
important for me
(11:43:05 AM) mikeal: the inspector and recorder will also be 
integrated with the Flash support
(11:45:11 AM) designs703: but as far as what they can test for a given 
website, are they similar?
(11:45:30 AM) mikeal: so
(11:45:34 AM) mikeal: both can get at anything in javascript
(11:45:45 AM) mikeal: the same domain stuff kills a few things for selenium
(11:45:57 AM) mikeal: any content from other domains, like images and such, 
you can't validate that they have loaded
(11:45:59 AM) designs703: yea, and we will be testing for multiple domains
(11:46:16 AM) mikeal: then you can't use selenium except in trust mode
(11:46:28 AM) mikeal: which is FF and IE only
(11:46:33 AM) mikeal: and the IE stuff is kinda funky
(11:47:06 AM) designs703: I think that windmill's probably a better fit for what 
I'm doing. I'm also a Python dev so I like to think that I'd have a better shot 
at solving any tricky problems that happen in the software
(11:47:17 AM) ctalbert left the room (quit: ).
(11:47:48 AM) mikeal: yeah, it's all Python and JavaScript
(11:47:53 AM) mikeal: and we support nsoe
(11:47:55 AM) mikeal: er nose
(11:48:48 AM) mikeal: which lets you integrate with other unittests pretty easily
(11:48:50 AM) designs703: right
(11:49:15 AM) designs703: I was put off by the whole FF addon dependency. maybe 
that isn't the case for selenium, but it seems to be
(11:50:08 AM) mikeal: Selenium RC wills upport FF without an addon
(11:50:20 AM) mikeal: but it doesn't include any debugging tools
(11:50:54 AM) mikeal: the only recorder/inspector for selenium are implemented in 
the addon
(11:53:26 AM) designs703: If I run % windmill firefox http://www.google.com/ (as 
in the video) and click the Play button in the Windmill popup, should windmill 
begin logging activity?
(11:54:18 AM) designs703: oh, one sec, I think I had that wrong
(11:55:23 AM) mikeal: the play button is for when you have actions loaded and 
need to play them
(11:55:33 AM) mikeal: you probably want to click the record button to record 
your actions
(11:56:12 AM) designs703: yep
(11:57:01 AM) designs703: OK, thanks for the advice, I'll play around with 
windmill some more

Q: How did Windmill solve cross domain scripting ?
A: Below you will find the IRC conversation:

[15:29] <mikeal> whenever the browser makes a request for a domain that isn't the current test domain
[15:29] <mikeal> windmill returns it a forward to that same path but at the test domain
[15:30] <mikeal> when the next request comes in to the proxy it knows, by the referer, which domain it's actually suppose to send it
[15:30] <mikeal> windmill keeps track of all the cross domain requests it's done so that it can look at any referer and know what domain it's really suppose to go to
[15:31] <mikeal> in some edge cases the referer is omitted and windmill will just loop through all the domains it has in it's registry
[15:31] <mikeal> in reverse order from when they were requested
[15:31] <mikeal> and there are some more edge cases
[15:31] <mikeal> you gotta blocklist add sites that return 200 to any request if you use any of them
[15:32] <mikeal> cross-domain POST is problematic and there is a bunch of code to handle that
[15:33] <mikeal> but at the end of the day, the browser just needs to think it never left the target domain so that all the windmill javascript that was loaded doesn't lose control due to cross domain security constraints
[15:33] <mikeal> and that includes SSL
[15:33] <mikeal> for SSL we do the same thing, we open the socket, pretend to be the remote domain, and return a forward
[15:33] <mikeal> we create a certificate on the fly for any remote domain
[15:34] <mikeal> which is why the SSL support requires that you make windmills signing key trusted
[15:34] <mikeal> that's pretty much it
[15:34] <mikeal> lots of little edge cases in the code
[15:34] <mikeal> but the method for doing it all isn't rocket science

Q: What makes debugging easier in Windmill than in Selenium ?
A: Below you will find the IRC conversation:

[15:42] <mikeal> two things
[15:42] <mikeal> when you run selenium with the RC it's not a back and forth between the RC server and the js on the client
[15:42] <mikeal> it just kinda throws it commands
[15:43] <mikeal> there is a lot of back and forth in windmill between Python and JavaScript
[15:43] <mikeal> then there are just a ton of features in the js end
[15:43] <mikeal> integrated Firebug
[15:43] <mikeal> exception information about all the failures
[15:44] <mikeal> just a lot of attention paid to showing as much information as possible when we can
[15:44] <mikeal> selenium2, using the webdriver stuff, is going to be even worse
[15:44] <mikeal> because there they find a node but simulate an event in the trusted space by position
[15:45] <mikeal> which means if the event doesn't propogate, or fails for some other reason, there isn't a good way to find out why

Q: How do I deal with Apache’s authorization dialog?
A: From the Windmill-dev list:

We work around our basic authentication problems by just using the very old http://username:password@url/ syntax to bypass the browser authentication dialog.

Another proposed solution was:

Try adding these 2 lines to the top of your WindmillHttp._request()
method in windmill/server/proxy.py (this is for the master branch)
import base64 headers['Authorization']="Basic "+base64.b64encode("yourUsername:yourPassword")

Q: Can I simulate “Browse for a file” click?
A: No. It’s a javascript browser restriction.