How to convert XLT scripts into Selenium?


How can i convert XLT scripts into selenium ?
Can I use this XLT code in test automation with Saucelabs ?

I am using the Saucelabs account for automating browsers.
Since XLT scripts exported in java, cannot be used to Saucelabs, can i convert XLT into Selenium, so that i can run it under Saucelabs.

Is there any quick way to convert xlt into selenium ?

For eg:-
XLT Scripts under AbstractWebDriverScriptTestCase subclass


How to convert this into selenium so that i can access like"//nav[@id='navigation']/ul[1]/li[4]/div/ul/li[1]/a");


Scripts exported to Java test cases do not obey the @TestTargets annotation provided by the Multi-Browser extension, however, that does not mean you are not able to execute these tests using SauceLabs.

In the constructor of your exported test case you simply need to pass a properly configured instance of RemoteWebDriver. In the example below, we would run the test with an iphone7 simulator:

public class TAddToCart extends AbstractWebDriverScriptTestCase
    public TAddToCart() throws MalformedURLException
        super(createSauceLabsDriver(), "");

    private static WebDriver createSauceLabsDriver() throws MalformedURLException
        String USERNAME = "YOUR_USERNAME";
        String ACCESS_KEY = "YOUR_ACCESS_KEY";
        String URL = "https://" + USERNAME + ":" + ACCESS_KEY + "";
        DesiredCapabilities caps = DesiredCapabilities.iphone();
        caps.setCapability("appiumVersion", "1.7.1");
        caps.setCapability("deviceName","iPhone 7 Simulator");
        caps.setCapability("deviceOrientation", "portrait");
        caps.setCapability("platformName", "iOS");
        caps.setCapability("browserName", "Safari");

        return new RemoteWebDriver(new URL(URL), caps);


Thanks J,
it worked …

But how to pass multiple browsers as params so that i could test my scripts in different environment ?