I want to run a selenium tests using python against a server farm that has about 50 web servers. What I have been doing is changing my host file (@ /etc/hosts) to switch to the desired server and run my selenium tests. This manual process can be tedious. Is there a better way to test these individual servers faster?
I’ve looked at using selenium grid to run these in parallel. But can’t find any real life examples using python. The selenium grid demo is vague and the example are mostly in ruby. I don’t really care if I do this in sequence (test server a, then test server b) or in parallel. Although parallel would be nice.
I’ve also looked and nose not sure if this is the right approach either. Of course I could dig deeper.
I’ve also looked at Sauce, from what I understand this is a paid service and don’t want to go down that road.
Any advice or direction would greatly help me.
As per my understanding, you are hitting a farm with same domain name but different IP addresses in it. Thats why changing the web address in selenium is not feasible and you make the modifications in the hosts file.
If that is so, you can setup a small Fake DNS server, configure your network interface to use it and put the logic of changing IP addresses in it. In this way you won’t have to tinker around with Selenium at all.
Here is one very primitive code snippet. However this will only resolve addresses for your server while other names won’t be resolved rendering other domains inaccessible.
If you are comfortable with Metasploit, you can give this DNS proxy a try. This will also resolve other queries but it might be difficult for you to make changes programatically to update your web-server’s resolve address.