Selenium

To pass additional capabilities to Selenium implement the following function in *.user.js file of a test.

function GetWebDriverNonProfileCapabilities(profile)
{
    var caps = {};

// set capabilities based on profile name
    if (profile == "Android")
    {
        caps["platformName"] = "Android";
        caps["platformVersion"] = "9";
        caps["deviceName"] = "Android Emulator";
        caps["browserName"] = "Chrome";
    }
    else if (profile == "iPhone")
    {
        caps["platformName"] = "iOS";
        caps["platformVersion"] = "11.4";
        caps["deviceName"] = "iPhone X";
        caps["browserName"] = "Safari";
        caps["automationName"] = "XCUITest";
        caps["newCommandTimeout"] = "300";
    }
    else if (profile == "iPad")
    {
        caps["platformName"] = "iOS";
        caps["platformVersion"] = "10.3";
        caps["deviceName"] = "iPad Air 2";
        caps["browserName"] = "Safari";
        caps["automationName"] = "XCUITest";
        caps["newCommandTimeout"] = "300";
    }    
    return caps;
}

This function is automatically executed by Rapise before creating a WebDriver instance.   Capabilities specified in the callback are applied after capabilities from a profile.

Appium

To pass additional capabilities to Appium implement the following function in *.user.js file of a test.

function GetAppiumNonProfileCapabilities(profile)
{
    var caps = {};
    
// set capabilities based on a profile name
    if (profile == "SL iOS Browser")
    {
        caps["name"] = "ios_check";
    }
    
    return caps;
}

This function is automatically executed by Rapise before creating an AppiumDriver instance.   Capabilities specified in the callback are applied after capabilities from a profile.