Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Most developers and testers usually takes advantage of Operation System Host File (commonly known as "hosts") to "trick" the S.O. and the browser to load websites and webservices from another server than the real production one. It's a very easy approach to be able to use the production host name of your site or service while pointing your computer to another server (staging, Q&A, etc).

This is acceptable when testing manually, but constrains test automation because I need to manipulate /etc/hosts file on each test machine and tests running in parallel may be impacted by this change.

Is there a way to create a browser with mapping specific only for this browser instance? Something like WebDriver capabilities? I know there are relevant plugins for Firefox ("Change Hosts"), but this makes my tests browser-specific.

share|improve this question

1 Answer 1

oh ok, that's a tricky one. This is what I know regarding this subject, see if it can help:
- only after you close the browser the changes you made take effect
- maybe you could, instead of using the hosts, use the name of the pc that has the app running, we do it in my company. I.E. PC1 has the app, instead of puting the ip and the url on the hosts file, you can just put the url on the browser http : // PC1 /...

Before editing....
Sorry for the reply, but I can't comment... Can't you just write a function (C#, Java, etc...) to change the hosts file?

share|improve this answer
1  
Nope, because "tests running in parallel may be impacted by this change." –  dzieciou Jun 25 at 11:53
    
oh ok, that's a tricky one. This is what I know regarding this subject, see if it can help: - only after you close the browser the changes you made take effect - maybe you could, instead of using the hosts, use the name of the pc that has the app running, we do it in my company. I.E. PC1 has the app, instead of puting the ip and the url on the hosts file, you can just put the url on the browser PC1... –  Jose Pita Jun 26 at 8:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.