Skip to content

[BUG] Can't work with some selectors #164

@VladToporkov

Description

@VladToporkov

undefined:1
{"id":5,"guid":"Frame@3f7bb17e06603ea8d8186b3190c0e61c","method":"click","params":{"selector":"xpath \u003d //*[text()\u003d\u0027�09B8\u0027]"}}
^

SyntaxError: Unexpected token � in JSON at position 130
at JSON.parse ()
at Transport.onmessage (/snapshot/playwright-cli/lib/driver.js:48:75)
at Immediate. (/snapshot/playwright-cli/node_modules/playwright/lib/protocol/transport.js:70:26)
at processImmediate (internal/timers.js:456:21)

testCode
@test
public void test () throws Exception {
Playwright playwright = Playwright.create();
List browserTypes = Arrays.asList(
playwright.chromium(),
playwright.webkit()
);
for (BrowserType browserType : browserTypes) {
BrowserType.LaunchOptions options = new BrowserType.LaunchOptions();
options.headless = false;
Browser browser = browserType.launch(options);
BrowserContext context = browser.newContext(
new Browser.NewContextOptions().withViewport(800, 600));
Page page = context.newPage();
page.navigate("http://ya.ru");
page.click("xpath = //*[text()='Найти']");
page.screenshot(new Page.ScreenshotOptions().withPath(Paths.get("screenshot-" + browserType.name() + ".png")));
browser.close();
}
playwright.close();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions