2

I want to handle server timeout in programmatically.

My codes goes like this.

SelendroidConfiguration config = new SelendroidConfiguration();
config.addSupportedApp("apk/test.apk");
selendroidServer = new SelendroidLauncher(config);

    URL url = new URL("http://localhost:4444/wd/hub");
    // -------------------------------------------------------
    SelendroidCapabilities test= SelendroidCapabilities
            .device("com.test.android:1.0");
    driver = new SelendroidDriver(url, test);
Biswatma
  • 107
  • 4
  • 17

4 Answers4

1

I had the same problem when tests started failing. You have set up the config already. Just add this line.

  config.setSessionTimeoutSeconds(60000);
Madis Kangro
  • 293
  • 3
  • 12
1

Though not applicable to SelendroidConfiguration, when launching selenium standalone using docker, --session-timeout flag inside SE_OPTS works:

docker run -d -p 4445:4444 -p 5901:5900 -p 7901:7900 -e SE_OPTS="--session-timeout 1000" --shm-size=2g selenium/standalone-chrome:105.0

It doesn't work with standalone-chrome-debug though:

docker run -d -p 4445:4444 -p 5901:5900 -p 7901:7900 -e SE_OPTS="--session-timeout 100" --shm-size=2g selenium/standalone-chrome-debug:3.141.59-20210607
Kira
  • 415
  • 4
  • 16
0

you can use this to increase it to 50 seconds

java -jar selendroid-standalone-0.11.0-with-dependencies.jar -timeoutEmulator 50000

source

Chandan Nayak
  • 10,117
  • 5
  • 26
  • 36
0

The most optional way to solve this is to add the following attribute to the cmd line: "-timeout". Keep in mind that its value should be included in seconds (it's 1800=30 min by default).

So it looks like this:

java -jar  -htmlSuite "various suite parameters" -timeout 3600

So, server shall remain active for an hour instead of 30 min. Interestingly enough, this is not well-documented and it's really hard to find a proper solution to alter this setting.

You can read more about it here: https://wiki.mozilla.org/Running_IDE_scripts_with_Selenium_RC

Aleksandras
  • 109
  • 2
  • 6