1

I am facing an using in automation. I just want to execute selenium script, which I wrote in eclipse via cmd. I haven't used testng or anything else.

public class claim {
    public static void main(String[] args) throws InterruptedException {
        System.setProperty("webdriver.chrome.driver","C://selenium-2.53.0//chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("http://toolsqa.wpengine.com/iframe-practice-page/");
        driver.quit();
    }
}

this is the demo script i want to run via cmd.

pagid
  • 13,559
  • 11
  • 78
  • 104

2 Answers2

0

Firstly you've to set env. classpath variable, in which you've to set path of selenium classes. after that you can run.. selenium scripts from anywhere in computer.. you can create bat file.. to run it through cmd.. or you can run like java program...

Eddie Singh
  • 58
  • 1
  • 10
0

why you want to run via cmd? run in eclipse as JUnit test.Or create job on Jenkins! is very good tool for execute scripth and good work with eclipse

007777ewq
  • 1
  • 1