1

How do I achieve Cross browser testing using Selenium with any BDD tool which can coded in Java.

My actual requirement is to use Selenium (code in Java) and use any mature BDD tool achieve cross browser testing. I have heard the Cucumber-JVM & Jbehave commonly used BDD tools for Java. However, I also hear that Cucumber-JVM does not support multi-threading concept and therefore cross browser execution cannot be achieved.

JavaLover
  • 73
  • 2
  • 14

2 Answers2

1

I'm not sure what you mean by " Cucumber-JVM does not support multi-threading concept and therefore cross browser execution cannot be achieved".

Cross-browser testing involves running the same site in different browsers and ensuring the behaviour doesn't change, to my knowledge. Cucumber-JVM (or JBehave) is an ideal tool for this, as you can specify the browser in the first step of your feature file, and then execute a common set of steps to prove compatibility.

Selenium provides the browser-choice portion of the code you need, so this is a simple and common use-case.

TrueDub
  • 5,000
  • 1
  • 27
  • 33
0

I run selenium tests in parallel with Cucumber-JVM fine. Cucumber-JVM HAD concurrency issues in the past, they have been since fixed in version 1.1.6. As long as you have Cucumber-JVM version >= 1.1.6 you should be fine. You can setup a maven project and have surefire configuration to run tests in parallel like below (For details, you can find my answer here). You can specify browser name as a maven variable like -Dbrowser.name=firefox or something along those lines to specify different browsers for cross browser testing.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <executions>
                    <execution>
                        <id>acceptance-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <outputEncoding>UTF-8</outputEncoding>
                            <parallel>classes</parallel>
                            <perCoreThreadCount>true</perCoreThreadCount>
                            <threadCountClasses>10</threadCountClasses>
                            <argLine>-Xmx1024m</argLine>
                            <argLine>-XX:MaxPermSize=256m</argLine>
                            <includes>
                                <include>**/Run*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
Community
  • 1
  • 1
nilesh
  • 14,131
  • 7
  • 65
  • 79
  • 1
    Hi, How can i configure maven surefire plugin to execute same set of cucumber features on 3 different browsers. By Using above solution we can run multiple features on same browser type parallel. How can we achieve vice versa i., running features on multiple browser types? – Vikas Aug 12 '15 at 09:56