grafana / xk6-browser

k6 extension that adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol
https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/browser/
GNU Affero General Public License v3.0
337 stars 42 forks source link

page.content() not working #322

Closed ampractise closed 2 years ago

ampractise commented 2 years ago

image page.contet() not working else if (env == 'perf') { url = 'https://www.google.com/'; }

const browser = launcher.launch('chromium', { headless: false, debug: false, slowMo: '500ms', });

const context = browser.newContext(); const page = context.newPage(); page.goto(url, { waitUntil: 'load' }); //page.waitForSelector(Locator.userName); let newvalue = page.content(); console.log(newvalue);

imiric commented 2 years ago

Hi, thanks for opening this issue!

It should be fixed by #327, so you can build a xk6-browser binary off that branch right now with xk6 build --with github.com/grafana/xk6-browser@097ca28405913158e2dd3257523a06d6d55a84d9, wait until it's merged and build it with xk6 build --with github.com/grafana/xk6-browser@main, or wait until end of June for the official v0.4.0 release.