package com.oxagile.project.web.tests.userprofile; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Action; import org.openqa.selenium.interactions.Actions; import java.util.concurrent.TimeUnit; public class TestTest { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "libs/chromedriver"); WebDriver wd = new ChromeDriver(); wd.manage().window().maximize(); wd.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); wd.get("https://react-avatar-editor.netlify.com/"); WebElement canvas = wd.findElement(By.cssSelector("canvas.editor-canvas")); Actions builder = new Actions(wd); Action dragAndDrop = builder .moveToElement(canvas, 10, 10) .pause(2000) .clickAndHold() .pause(2000) .moveToElement(canvas, 100, 100) .pause(2000) .release() .build(); dragAndDrop.perform(); wd.quit(); } }
- Форум тестировщиков
- → Публикации shukhov