How to add our own Selenium grid for load testing


#1

Hi,

is there a working example configuration for using a custom Selenium Grid?

I am using credentials.properties

browserprofile.testEnvironment.saucelabs.url = http://mygrid.com:4444/wd/hub
browserprofile.testEnvironment.saucelabs.username =
browserprofile.testEnvironment.saucelabs.password =

Setting in project.properties

com.xceptance.xlt.propertiesInclude.1 = credentials.properties

And setting in browser.properties

browserprofile.ChromeGrid.name = Chrome_grid
browserprofile.ChromeGrid.browser = chrome
browserprofile.ChromeGrid.version = 66.0.3359.117
browserprofile.ChromeGrid.testEnvironment = saucelabs

The load testing execution with the mastercontroller ignores the settings and starts the tests locally.

A standard test class is used

package multibrowser.search;

import org.junit.Test;

import xltutil.AbstractAnnotatedWebDriverScriptTestCase;
import xltutil.annotation.TestTargets;

@TestTargets( { “Chrome_grid” } )
public class TMyTest extends AbstractAnnotatedWebDriverScriptTestCase
{

@Test
public void test()
{
    startAction("Homepage");
    open("https://blog.xceptance.com/");
    assertText("css=h1.site-title", "Passionate Testing");
}

}


#2

Hm, that is strange. If your grid test case works okay when run locally from within your IDE, then it should work the same way on the load agent. But don’t forget to re-upload the test suite to the load agents after making any change.


#3

Thanks for your input, after executing the test in the IDE, I realized it was just a matter of setting the profile name correctly when using empty spaces:

browserprofile.Chrome_grid.name = Chrome grid
browserprofile.Chrome_grid.browser = chrome
browserprofile.Chrome_grid.version = 66.0.3359.117
browserprofile.Chrome_grid.testEnvironment = saucelabs