Skip to content

MustWaitStable() is incompatible with MustWaitRequestIdle() #1224

@chenghonour

Description

@chenghonour

Use MustWaitRequestIdle based on the sample code, but once MustWaitStable is added, The output is not as expected.
rod version is v0.116.2

func main() {
	browser := rod.New().MustConnect()
	defer browser.MustClose()

	page := browser.MustPage("https://duckduckgo.com/")
	//page.MustWaitStable() // If this line is used, the MustWaitRequestIdle function will not work.

	// Start to analyze request events
	wait := page.MustWaitRequestIdle()

	// This will trigger the search ajax request
	page.MustElement("#searchbox_input").MustClick().MustInput("lisp")

	// Wait until there's no active requests
	wait()

	// We want to make sure that after waiting, there are some autocomplete
	// suggestions available.
	fmt.Println(len(page.MustElements(".searchbox_suggestions__5vqa7")) > 0)
	time.Sleep(20 * time.Second)
}

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