fix 2: PlayWright-firstScript
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package zacksolutions;
|
||||
|
||||
|
||||
import com.microsoft.playwright.Browser;
|
||||
import com.microsoft.playwright.Page;
|
||||
import com.microsoft.playwright.Playwright;
|
||||
@@ -9,14 +8,16 @@ import org.testng.annotations.Test;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class BrowserLaunchTest {
|
||||
@Test
|
||||
public void browserLaunch(){
|
||||
try(Playwright playwright = Playwright.create()){
|
||||
Browser browser = playwright.chromium().launch();
|
||||
Page page = browser.newPage();
|
||||
page.navigate("https://zenful.cloud");
|
||||
System.out.println(page.title());
|
||||
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("photo.png")));
|
||||
}
|
||||
@Test
|
||||
public void browserLaunch() {
|
||||
try (Playwright playwright = Playwright.create()) {
|
||||
Browser browser = playwright.chromium().launch();
|
||||
Page page = browser.newPage();
|
||||
page.navigate("https://zenful.cloud");
|
||||
System.out.println(page.title());
|
||||
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("photo.png")));
|
||||
page.type("input[id='message']", "4 8 15 16 23 42");
|
||||
page.click("button");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user