sclevine / agouti

A WebDriver client and acceptance testing library for Go
MIT License
822 stars 105 forks source link

Ability to focus on an element? #207

Open jub0bs opened 4 years ago

jub0bs commented 4 years ago

I'm trying to navigate down a JavaScript-heavy page. Is there any way to focus on a given page element (e.g. to force an infinite scroll to kick in)?

spaiki007 commented 4 years ago

for i := 0; i < 10000; i += 500 { page.RunScript("window.scrollTo(0, offset);", map[string]interface{}{"offset": i}, nil) time.Sleep(1000 * time.Millisecond) }