In a browser there's often arrow buttons that go forward and backward in history:
Can these buttons be clicked on via playwright?
There's no elements for them so I was wondering if this is possible...
await navigationObject(page).backButton.click();
In a browser there's often arrow buttons that go forward and backward in history:
Can these buttons be clicked on via playwright?
There's no elements for them so I was wondering if this is possible...
await navigationObject(page).backButton.click();
Share
Improve this question
edited Nov 3, 2022 at 18:22
tenshi
26.3k4 gold badges27 silver badges60 bronze badges
asked Nov 3, 2022 at 15:28
Sundeep SandhuSundeep Sandhu
911 gold badge1 silver badge4 bronze badges
2 Answers
Reset to default 17For nodejs
await page.goBack()
Or
await page.goForward()
For python
await page.go_back()
Or
await page.go_forward()
You can find more info here: https://playwright.dev/docs/api/class-page#page-go-back
Try the History API:
window.history.back()
and
window.history.forward()
See: https://developer.mozilla.org/en-US/docs/Web/API/History_API