I have seen several posts about this topic, though it’s not a very common question/request. But there’s been no talk of a solution yet.
Thought I’d share some my idea of a theoretical solution that just needs to be proven out by someone or group of people via a proof of concept prototype implementation.
So, here’s the idea in question: you’ve worked with AutoIt, and/or Sikuli, and/or other tool together with Selenium to perform your desired web automation, where Selenium by itself could not do. But now you need to scale tests up, ideally with Selenium Grid. But uh oh, you can’t seem to use AutoIt or other tool with Grid anymore. Why is that?
Short answer – your lack of understanding of how AutoIt or other tool really works compared to Selenium and Selenium Grid. They weren’t designed to operate under a “grid” mode, unlike Selenium. So how do you make it all work?
Using specific browser environments option with Selenium Grid and build upon that. Start by reading this article:
http://selenium-grid.seleniumhq.org/how_it_works.html
Based on that, create startup scripts for the hub & nodes that can define the specific environment labeling, where order of “node 1″ to N is calculated at startup. The mapping can then be saved to file or database like follows:
environment label name,SeleniumNodeHostnameOrIp,SeleniumNodePort
from there external tools (AutoIt, Sikuli, etc.) can be started up or set up similarly with additional fields to the mapping like
environment label name,SeleniumNodeHostnameOrIp,SeleniumNodePort,AutoItHost,AutoItPort,OtherAutoItDetailsAndFields
In example above, if hostname or IP same for Selenium and AutoIt on same machine, can just use same shared field instead of duplicating host field. Ports will obviously be different. OtherAutoItDetailsAndFields could be things like usename, password, etc. if using tools like PSExec.exe to call it remotely. Though I’d recommend calling AutoIt over XML-RPC server or other web service than to use PSExec in this grid setup. To elaborate, that means build an XML-RPC or other web service server that you can make API calls to that will then forward to AutoIt on same server machine to perform the requested AutoIt action (via API call).
Now with the mapping, just modify test scripts or test framework to do a lookup at runtime, where if passing or given environment label as runtime argument/parameter, look up via the mapping, the matching host and port to use for Selenium connection and matching host and connection info for other tool. Your test then doesn’t need to have hard coded values and can operate under a grid config. You just use template variables for hard coded values, that get replaced by the lookup at runtime.
This should work in theory, now just for people to try it out, I don’t have the time and priority to do this myself yet. Anyone done something like this before already? I’m guessing probably not yet. I’d love to hear what you think or how your progress on this is going.
And if you still don’t understand my theoretical solution, just contact me, and perhaps you might also need to learn more about distributed network computing as that is what this is based on.
Update 1/7/2012: This solution presented is for Selenium RC Grid, for Selenium Grid2, the method doesn’t quite apply as the “requesting specific environment” option is not in Selenium Grid2. But one could derive a similar solution in code by extracting the host (and maybe port) info of the node the test is currently executed on, and map this the same way I’ve presented for the RC solution, you use same host (but different port) to access the AutoIt/Sikuli server that’s also running on same Selenium node. Example of how to get the host and port info for Selenium Grid2 node in Java:
http://groups.google.com/group/webdriver/browse_thread/thread/415b17c853a5ccbc
https://gist.github.com/1766772
Update 4/2/2012: another option for Grid2 using special parameters (like applicationName) from capabilities object.
http://groups.google.com/group/selenium-users/browse_thread/thread/3d1b0405c6e93653
Update 5/9/2012: or custom capability matcher or custom grid plugin
http://groups.google.com/group/selenium-users/browse_thread/thread/4806d0f1ec9dca8a/0e551e64586493fb?hl=en
http://groups.google.com/group/webdriver/browse_thread/thread/1eec95202243f9e7
Tags: Automation, Selenium