I’ve been working in an interesting project for Browser Automation for the TeamMentor product and during this time I had the opportunity to learn very interesting approaches to create a framework for browser automation.
Our approach is to have the capability of running all our unit test in the browsers :Firefox,Chrome and Internet Explorer. The first time you run your automation test in Chrome or Internet Explorer you need to download their respective drivers (which are standalone servers which implements WebDriver’s wire protocol.).
The Internet Explorer driver (namely IEDriverServer.exe) is available for x86 (32 bit platform) and x64(64 bit platform) Operative Systems architecture.
Since this driver are required and the path where the drivers reside needs to be clearly defined, our automation project automatically downloads it and sets the working path. This interesting feature makes easy the testing process:
Deciding what driver architecture to use
Considering that our automation test might be executed in different bit platforms (the Internet Explorer driver is available for both platforms),it is necessary to identify the bit platform before using the driver, the below C# code help us :
var is64BitOperatingSystem = Environment.Is64BitOperatingSystem; var downloadUrl = is64BitOperatingSystem ? IEDriverDownloadLinkx64 : IEDriverDownloadLinkx86;