We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Click
Expected usage:
import { chromium } from 'k6/x/browser'; export default function() { const context = chromium.launch().newContext(); const page = context.newPage(); page.goto('https://test.k6.io/', { waitUntil: 'networkidle' }); const elem = page.$('a[href="/my_messages.php"]'); elem.click().then(() => { page.$('input[name="login"]').type('admin'); page.$('input[name="password"]').type('123'); return page.$('input[type="submit"]').click(); }).then(() => { page.waitForLoadState('networkidle'); }).finally(() => { page.close(); browser.close(); }); }
If k6 had supported async/await:
async
await
import { chromium } from 'k6/x/browser'; export default function() { const context = chromium.launch().newContext(); const page = context.newPage(); page.goto('https://test.k6.io/', { waitUntil: 'networkidle' }); const elem = page.$('a[href="/my_messages.php"]'); await elem.click(); page.$('input[name="login"]').type('admin'); page.$('input[name="password"]').type('123'); await page.$('input[type="submit"]').click(); page.waitForLoadState('networkidle'); page.close(); browser.close(); }
The text was updated successfully, but these errors were encountered:
Page.Click
Update locator.click to async
40c3e4e
Related: #311 and #439 Updates: #100 Closes: #660
12226ca
3044fad
inancgumus
Successfully merging a pull request may close this issue.
Expected usage:
If k6 had supported
async
/await
:The text was updated successfully, but these errors were encountered: