How to modify test scripts for Saucelabs automation?


#1

While checking with Saucelabs browser automation, I found that only the test script (xml) is taken.
Modified scripts exported as junit class is not considered while running test automation in saucelabs.
Where to configure this, so that the modified scripts would be considered for automation ?

Right now my code looks like this

@ScriptName(“menu.item.check.TcheckEachMenu”)
@TestTargets(
{
//
“IE11_SauceLabs”,
“Firefox_SauceLabs”,
“Chrome_SauceLabs”,
// “Chrome_1024x768”,
// “Chrome_1500x1000”,
// “FF_1024x768”,
// “FF_1500x1000”,
“Safari10_SauceLabs”,
// “Galaxy_Note3_Emulation”,
// “iphone5”
})
public class TcheckEachMenuItemMB extends AbstractAnnotatedScriptTestCase
{

}

package menu.item.check;

import org.junit.After;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.xceptance.xlt.api.webdriver.XltDriver;
import com.xceptance.xlt.api.engine.scripting.AbstractScriptTestCase;
import com.xceptance.xlt.api.engine.scripting.AbstractWebDriverScriptTestCase;
import com.xceptance.xlt.api.engine.scripting.ScriptName;

/**

  • TODO: Add class description
    */

@ScriptName(“menu.item.check.TcheckEachMenu”)
public class TcheckEachMenuItem extends AbstractWebDriverScriptTestCase
{

/**
 * Constructor.
 */
public TcheckEachMenuItem()
{
    super(new XltDriver(false), "http://demo-na01-tatcha.demandware.net");
}

@Test
public void test() throws Throwable
{
//…//
}

package menu.item.check;
import org.junit.After;
import org.junit.Test;
import org.openqa.selenium.WebDriver;

import com.xceptance.xlt.api.engine.scripting.AbstractScriptTestCase;
import com.xceptance.xlt.api.engine.scripting.ScriptName;

//import bwdrivers.BrowserDriver;

//import bwdrivers.BrowserDriver;

/*

  • NOTE: This file is generated. Do not edit! Your changes will be lost.
    */
    @ScriptName(“menu.item.check.TcheckEachMenu”)
    public class TcheckEachMenu extends AbstractScriptTestCase
    {
    private String baseURL = “http://demo-na01-tatcha.demandware.net”;

}


#2

Currently, the multi-browser extension supports XML script test cases only. Once you export an XML script test case to Java, you are on your own when it comes to multi-browser support.

However, the source code for multi-browser is available on GitHub.

Feel free to fork the code and add the support for exported test cases. Pull requests are welcome!


closed #3