mardi 17 septembre 2019

Trying to call a static method to use as Desired Capabilities

Im trying to call some desired capabilities from a static method and use these to open an online emulator but i cant seem to figure out how to get it to work.

public class config {
 public static final DesiredCapabilities desireCapabilitites_iphone7(){

    DesiredCapabilities capabilities = new DesiredCapabilities();
    // The generated session will be visible to you only.
    capabilities.setCapability("sessionName", "Automation test session");
    capabilities.setCapability("sessionDescription", "");
    capabilities.setCapability("deviceOrientation", "portrait");
    capabilities.setCapability("captureScreenshots", true);
    capabilities.setCapability("browserName", "safari");
    capabilities.setCapability("deviceGroup", "KOBITON");
    capabilities.setCapability("deviceName", "iPhone 7");
    capabilities.setCapability("platformVersion", "12.1.2");
    capabilities.setCapability("platformName", "iOS");

    return capabilities;
}

Im trying to call this into a test but i keep getting the "cannot resolve constructor" error.

public class invalid_url_test {

    public static RemoteWebDriver driver = null;


@BeforeClass
public void setup(){


    String mobileServerUrl = "https://urllogin.com/wd/hub";
    driver = new RemoteWebDriver (mobileServerUrl, config.desiredCapabilitites_galaxys9());



}

Im using selenium and its written in java, I tried changing it to androidDriver but dont think it will work correctly with an android driver, ive also tried making the RemoteWebDriver private but still cant get it to work.

Aucun commentaire:

Enregistrer un commentaire