Search code examples
javaselenium-webdrivercross-browsercucumbercucumber-jvm

Cross Browser Testing using Cucumber sequentially?


I want to run the same feature files on different browsers sequentially. For example TestingExpression.feature,TestingExpression2.feature,.... all these feature files have to run on browsers(Chrome,Mozilla and IE) sequentially


Solution

  • I'd suggest writing a shell script (batch file) that does something like

    cucumber BROWSER=chrome
    cucumber BROWSER=mozilla
    cucumber BROWSER=ie
    

    and have something in your cucumber setup that picks up the BROWSER environment variable and configures whatever you are using to drive your browsers to use the appropriate one.

    This will collate all you chrome, mozilla and ie results together. You can modify this approach to pass in extra arguments to cucumber so you can control which features/scenarios are run.