0

Hi can somebody tell me please what am I doing wrong in running parallel tests on Selenium server?
I have this simple parallel tests in the class:

package tests;

import categories.Category1;
import com.google.code.tempusfugit.concurrency.ConcurrentTestRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

@RunWith(ConcurrentTestRunner.class)
@Category(Category1.class)
public class ParalelTest extends Base
{
    protected String siteUrl = "/waitforit.php";

    @Before
    public void setUp()
    {
        driver.get(baseUrl + siteUrl);
    }

    @Test
    public void test1()
    {
        System.out.println("test1() thread name: " + Thread.currentThread().getName());
    }

    @Test
    public void test2()
    {
        System.out.println("test2() thread name: " + Thread.currentThread().getName());
    }

    @Test
    public void test3()
    {
        System.out.println("test3() thread name: " + Thread.currentThread().getName());
    }

    @Test
    public void test4()
    {
        System.out.println("test4() thread name: " + Thread.currentThread().getName());
    }
}

Here is the screen with error: enter image description here

What is wrong with that? Without server it works fine.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Čamo
  • 3,863
  • 13
  • 62
  • 114

1 Answers1

-1

This error message...

org.openqa.selenium.NoSuchSessionException: no such session

...implies that the chromedriver=80.0 wasn't able to initiate/spawn a new Browsing Context with Chrome Browser v80.0.


Your main issue is the version incompatibility between the binaries you are using as follows :

  • Though you are using latest Selenium Client version 3.141.59, Chrome Driver version 80.0 and Chrome version v80.0.
  • Your JDK version is 1.8.0_65 which is pretty ancient.

Solution

A generic solution would be to:

  • Upgrade JDK to recent level of JDK 8u241.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.

Update

However, the invalid session ID error is a WebDriver error that occurs when the server does not recognize the unique session identifier. This happens if the session has been deleted or if the session ID is invalid.

A WebDriver session can be deleted through either of the following ways:


Reference

You can find a relevant detailed discussion in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352