Reputation: 27855
I use watir to test a test version of a website. To do so, I have to modify my hosts-file
Is there a way to get the same result without modifying the hosts file?
The obvious idea to replace the domain with the ip-address in the calling uri does not work.
I define my hosts like
10.10.10.10 http://www.example.net/
Then I test:
http://www.example.net/myapp
http://www.example.net/myapp_auth
.This call in step 3 is no relative call (a subpage of the actual domain) but a call with full url.
Without the hosts change, my test with http://10.10.10.10/myapp
would make the authorization test in my test system (10.10.10.10
) and then call the productive system on http://www.example.net/
.
So my question: Is there a way to use watir with a kind of internal hosts file?
Upvotes: 1
Views: 3393
Reputation: 527
You could set up a simple DNS server using something such as rubydns, add this on localhost to your DNS lookup list. If it is not there, DNS lookup should fall through (and quickly on the local loopback), if it is there, you can direct example.net
back to localhost for all callers on your machine.
Upvotes: 2