Содержание
- 2. Gradle settings buildscript { repositories { jcenter { url "http://jcenter.bintray.com/" } } } allprojects { repositories
- 3. Gradle settings dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java compile group: 'org.seleniumhq.selenium',
- 4. Gradle Settings test { testLogging { // Make sure output from // standard out or error
- 5. jUnit Annotation @BeforeClass public static void createAndStartService() throws IOException { service = new ChromeDriverService.Builder() .usingDriverExecutable(new File("\\chromedriver.exe"))
- 6. jUnit Annotation @Before public void setUp() throws Exception { driver = new ChromeDriver(service); driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS); driver.manage().window().maximize();
- 7. jUnit Annotation @Test public void openGoogle() throws Exception { driver.get("http://google.com.ua"); driver.findElement(By.id("id")).click(); driver.findElement(By.xpath(".//*[@id='root']/form/input[2]")).sendKeys("dadkhb"); }
- 8. jUnit Annotation @After public void closeDriver() throws Exception{ driver.close(); }
- 10. Скачать презентацию