Rayrun
← Back to Discord Forum

I am using playwright-go and facing some issues with wait methods...Need Help

I had with migrate my Js code using playwright package to golang code using playwright-go,but i am facing issue with few parts of code Js code::"// Click [placeholder="Last Name"] await page .locator(//input[@id='lastName-input']) .waitFor({ state: "visible" }); await page.locator(//input[@id='lastName-input']).click(); await page.locator(//input[@id='lastName-input']).fill("Rector"); " my go code with a error in waitforloadstate method "// Click [placeholder=="Last Name"] if _, err := page.Locator(//input[@id='lastName-input']).WaitForLoadState({ state: "visible", });

if err := page.Locator(`//input[@id='lastName-input']`).Click(); err != nil {
    log.Fatalf("could not click last name input: %v", err)
}

// Fill [placeholder="Last Name"]
if err = page.Locator(`//input[@id='lastName-input']`).Fill("Rector"); err != nil {
    log.Fatalf("could not fill last name input: %v", err)
}"

can someone please help,really appreicated thanks

This thread is trying to answer question "How can I resolve the issue with the waitForLoadState method in my Golang code while migrating from JavaScript using playwright?"

0 replies

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].