Skip to content

How to Run Local Driver #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SysSU opened this issue Dec 3, 2023 · 1 comment
Open

How to Run Local Driver #127

SysSU opened this issue Dec 3, 2023 · 1 comment

Comments

@SysSU
Copy link

SysSU commented Dec 3, 2023

I followed the instructions per the Readme to implement this into an existing project. The tests are now all running in Browserstack, but how can I set this up to specify running the tests using Browserstack or local webdirver for each run. So for example if I'm debugging/creating a test I would like to run it against my local browser, but when I'm actually performing tests either on my local machine or on a CI/CD I would like them to run on Browserstack.

I was initially trying to accomplish this by creating an if statement based on a TestNG parameter in the setup code, but I'm not sure how to get it to work. Something like this:

  String runType = System.getProperty("runType") != null ? System.getProperty("runType") : "local";

  if (runType.equals("browserStack")) {
    // Setup browserstack driver
    System.out.println("Running on BrowserStack");
    URL bsUrl = new URL("https://hub.browserstack.com/wd/hub");
    MutableCapabilities capabilities = new MutableCapabilities();
    driver = new RemoteWebDriver(bsUrl, capabilities);
  } else {
    // Setup local driver
    driver = new ChromeDriver();
  }
@hritik-m
Copy link

hritik-m commented Dec 4, 2023

I would request you to please create a ticket by forwarding the concern to [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants