Last active
September 26, 2019 00:34
-
-
Save devops-school/457ba325618ba77acab950b8fbc1c7b2 to your computer and use it in GitHub Desktop.
Demo for Selenium ChromeDriver wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
/** | |
* @author Nils Schuette via frontendtest.org | |
*/ | |
public class RunTest { | |
static WebDriver webDriver; | |
/** | |
* @param args | |
* @throws InterruptedException | |
*/ | |
public static void main(final String[] args) throws InterruptedException { | |
// Telling the system where to find the chrome driver | |
System.setProperty( | |
"webdriver.chrome.driver", | |
"C:/PATH/TO/chromedriver.exe"); | |
// Open the Chrome browser | |
webDriver = new ChromeDriver(); | |
// Waiting a bit before closing | |
Thread.sleep(7000); | |
// Closing the browser and WebDriver | |
webDriver.close(); | |
webDriver.quit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment