So to simulate any browser, user-agent should be altered accordingly before making request. User-agent is basically a string that represents the browser engine, browser version, OS and OS version etc.īrowser will send user-agent header with every http request to server. Most of the websites depend on user-agent string to find out from which OS and Browser the request is coming and then change the business logic accordingly or even redirect to different website.įor example, when browsing on mobile you will observe will automatically redirect to m. The intention of testing here was not to validate the layout or look and feel of the website but rather validating features such as presence or absence of a button based on the OS on which we are browsing. To support the new requirement, I leveraged 'user-agent' feature of the browser to simulate safari browser on Windows client machine. But automation framework supports only Windows machines. In my project there was a requirement to automate few test cases that would validate functionality of the website on Safari browser on Mac machine.