Wednesday, September 9, 2015

Running Selenium WebDriver on both Mac and Windows OS

Introduction

I've been working for a project that must execute Selenium WebDriver tests on both Windows and Mac operating systems. Unfortunately, for those who prefer c# instead java, we cannot install Visual Studio on Mac. But there is an alternative.

Xamarin Studio

The tool comes with a starter edition, which is free and can be downloaded from here: https://store.xamarin.com/ (look for 'Try Xamarin Starter Edition'). With this you can create library projects and nunit projects for your selenium tests.



How does the solution look like?
- you can create a library project to store the pages definition
- you can create a nunit project to store the tests to be executed
For more details about Selenium Web Driver Page Objects you can watch these presentations on pluralsight:
http://www.pluralsight.com/courses/selenium
http://www.pluralsight.com/courses/automated-testing-framework-selenium



With Xamarin Studio you have possibility to add the solution in a Version Control System, like git for Visual Studio Online.
This tool will be used when writing tests on Mac. On Windows you can use either Xamarin or Visual Studio (for the same solution). I prefer Visual Studio because I can benefit from the functionality of Resharper.

Jenkins

The next step is to include your solution in a continuous integration system. I use Jenkins for this.
For Mac, use this version: https://github.com/stisti/jenkins-app

Conclusions

By using Xamarin on Mac and Visual Studio on Windows and for example git for Visual Studio Online, you can run tests included in the same solution and have different configurations in Jenkins, like:
- Windows + Chrome
- Windows + Firefox
- Windows + IE
- Mac + Firefox
- Mac + Chrome

Next week I'll explain how to create a Jenkins configuration for Mac.

Happy testing and... make it green, becomes a dream :).
For every post I'll recommend something to read. The link for today is:  Xamarin Cross-platform Application Development - Second Edition

1 comment:

  1. This is the most demanding one in software testing.......
    Tableau Online Training> is the best institute providing class room / online training with best professionals with complete guidance & assistance ...

    ReplyDelete

Popular Posts