Search code examples
seleniumtestingautomated-testsrobotframeworkfitnesse

robot framework: org.openqa.selenium.NoSuchSessionException


I'm trying to get my first robot test running, but whatever I try, I get the following exception:

org.openqa.selenium.NoSuchSessionException

My test looks like

*** Settings ***
Documentation  A resource file containing the application specific keywords
Library     Selenium2Library

*** Test Cases ***
Check out www google dot com
    Open Browser  https://www.google.com  htmlunit
    Close Browser

enter image description here

Im using the following versions:

    <version.robot>3.0.2</version.robot>
    <version.robot.maven.plugin>1.4.7</version.robot.maven.plugin>
    <version.selenium2library>1.4.0.8</version.selenium2library>

It's caused by something in the following jar.

<dependency>
            <groupId>com.github.markusbernhardt</groupId>
            <artifactId>robotframework-selenium2library-java</artifactId>
            <version>${version.selenium2library}</version>
            <scope>test</scope>
        </dependency>

When I add this dependency also fitnesse test (whithout this jar it's working) gives the same exception.


Solution

  • The problem was that I used Fitnesse, Cumber and Robot Framework in 1 maven module. It's for a demo application to show how these framworks can fit in our jenkins 2 pipeline. Fitnesse and Cucumber were using Selenium 3 and robotframework-selenium2library-java doesnt seem to work with a Selenium 3. So there are conflicts.

    To solve this I put every test framework in a seperate maven module wich will fix the problem. Also gives this me more flexibility with the selenium versions in the future.