I am only able to navigate to 1 page once through the auth flow. Every subsequent page.goto call does nothing.
console.log doesn’t seem to work either, making debugging very painful
import { chromium } from 'k6/experimental/browser';
export default async function () {
const browser = chromium.launch({
headless: false,
});
const page = browser.newPage();
// go to home page with 'sign-in' button....this works
try {
await page.goto('<sign-in page here>', {
waitUntil: 'networkidle'
});
//this is the ONLY page I am able to load....and it happens AFTER all of the below actions
await page.goto('<page behind auth flow');
//click button on sign-in page...this works
await Promise.all([
await page.locator('[data-id="signin-button"]').click(),
await page.waitForNavigation()
]);
//fill in email....this works
await Promise.all([
await page.locator('input[name="email"]').type('<email>'),
await page.locator('button[type="submit"]').click(),
await page.waitForNavigation()
]);
//fill in sign-in form....this works
await Promise.all([
await page.locator('#pseudonym_session_unique_id').type('<email>'),
await page.locator('#pseudonym_session_password').type('<password>'),
await page.click('button.Button--login'),
await page.waitForNavigation()
]);
//click 'authorize button....this works
await Promise.all([
await page.locator('input[value="Authorize"]').click(),
await page.waitForNavigation()
]);
// the below action NEVER HAPPENS!!
await page.goto('https://www.google.com');
} finally {
page.close();
browser.close();
}
}
Currently, the browser module only supports the following async APIs, and so you only need to work with the await keyword for these APIs. All other APIs are synchronous, so you don’t need to use await for those. Using the await keyword with a synchronous API may result in unexpected behaviour.
Async APIs:
locator.click
elementHandle.click
frame.click
frame.goto
frame.waitForFunction
frame.waitForNavigation
page.click
page.goto
page.waitForFunction
page.waitForNavigation
browserContext.setExtraHTTPHeaders
browser.on
When working with Promise.All, you shouldn’t need to work with the await keyword within the list of async APIs that are being called. This could cause some unexpected behaviour.
When working with a click action that performs a navigation, it’s best to call waitForNavigation before calling the click. This prevents a known race condition.
Taking all this into account i’ve amended your script, so give it a try and let me know how it goes. If it doesn’t work, can you paste the output in your reply too?
import { chromium } from 'k6/experimental/browser';
export default async function () {
const browser = chromium.launch({
headless: false,
});
const page = browser.newPage();
// go to home page with 'sign-in' button....this works
try {
await page.goto('<sign-in page here>', {
waitUntil: 'networkidle'
});
//this is the ONLY page I am able to load....and it happens AFTER all of the below actions
await page.goto('<page behind auth flow');
//click button on sign-in page...this works
await Promise.all([
page.waitForNavigation(),
page.locator('[data-id="signin-button"]').click()
]);
page.locator('input[name="email"]').type('<email>')
//fill in email....this works
await Promise.all([
page.waitForNavigation(),
page.locator('button[type="submit"]').click()
]);
page.locator('#pseudonym_session_unique_id').type('<email>')
page.locator('#pseudonym_session_password').type('<password>')
//fill in sign-in form....this works
await Promise.all([
page.waitForNavigation(),
page.click('button.Button--login')
]);
//click 'authorize button....this works
await Promise.all([
page.waitForNavigation(),
page.locator('input[value="Authorize"]').click()
]);
// the below action NEVER HAPPENS!!
await page.goto('https://www.google.com');
} finally {
page.close();
browser.close();
}
}
Thank you @ankur ! I appreciate that feedback. What you’ve said makes sense; however there is no difference in behavior after making those changes. The output is below:
WARN[0009] url:[redacted]/favicon.ico method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0010] url:https://fonts.gstatic.com/s/nunitosans/v15/pe0TMImSLYBIv1o4X1M8ce2xCx3yop4tQpF_MeTm0lfGWVpNn64CL7U8upHZIbMV51Q42ptCp7t1R-s.woff2 method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0010] url:https://fonts.gstatic.com/s/nunitosans/v15/pe0TMImSLYBIv1o4X1M8ce2xCx3yop4tQpF_MeTm0lfGWVpNn64CL7U8upHZIbMV51Q42ptCp7t1R-s.woff2 method:GET err:fetching response body: No data found for resource with given identifier (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0011] url:[redacted] method:POST err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
INFO[0012] {} source=browser-console-api
WARN[0013] url:[redacted]?email=jbelliveau@newsbank.com&application_id=[redacted]
method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0016] "Translation for \"If left empty link, text will display as course link name\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Count\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Document\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Selection\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Words\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Characters (no spaces)\" in \"en\" is missing" source=browser-console-api
WARN[0016] "Translation for \"Characters\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Afrikaans\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Albanian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Arabic\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Belarusian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Bulgarian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Catalan\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Chinese\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Croatian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Czech\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Danish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Dutch\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"English\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Estonian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Filipino\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Finnish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"French\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Galician\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"German\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Greek\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Haitian Creole\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Hindi\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Hungarian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Icelandic\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Indonesian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Irish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Italian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Japanese\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Korean\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Latvian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Lithuanian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Macedonian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Malay\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Maltese\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Norwegian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Persian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Polish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Portuguese\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Romanian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Russian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Serbian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Slovak\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Slovenian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Spanish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Swahili\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Swedish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Tagalog\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Thai\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Turkish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Ukrainian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Vietnamese\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Welsh\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Yiddish\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"English (Canada)\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"English (Australia)\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"English (United Kingdom)\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"French (Canada)\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Hebrew\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Armenian\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Māori (New Zealand)\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Norwegian Bokmål\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Norwegian Nynorsk\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Chinese Simplified\" in \"en\" is missing" source=browser-console-api
WARN[0017] "Translation for \"Chinese Traditional\" in \"en\" is missing" source=browser-console-api
WARN[0020] url:https://heapanalytics.com/h?[redacted]Input%20text&i0=pseudonym_session_password&y0=%40div%3B%23application%3B.ic-app%3B%7C%40div%3B%23wrapper%3B.ic-Layout-wrapper%3B%7C%40div%3B%23main%3B.ic-Layout-columns%3B%7C%40div%3B%23not_right_side%3B.ic-app-main-content%3B%7C%40div%3B%23content-wrapper%3B.ic-Layout-contentWrapper%3B%7C%40div%3B%23content%3B.ic-Layout-contentMain%3B%5Brole%3Dmain%5D%3B%7C%40div%3B.ic-Login%3B%7C%40div%3B.ic-Login__container%3B%7C%40div%3B.ic-Login__content%3B%7C%40div%3B.ic-Login__innerContent%3B%7C%40div%3B.ic-Login__body%3B%7C%40form%3B%23login_form%3B%5Baccept-charset%3DUTF-8%5D%3B%5Baction%3D%2Flogin%2Fcanvas%5D%3B%5Bmethod%3Dpost%5D%3B%7C%40div%3B.ic-Form-control%3B.ic-Form-control--login%3B%7C%40input%3B%23pseudonym_session_password%3B.ic-Input%3B.text%3B%5Bname%3Dpseudonym_sessionpassword%5D%3B%5Brole%3Dtextbox%5D%3B%5Btype%3Dpassword%5D%3B%7C&ts0=1683575911528&ubv0=112.0.5615.139&upv0=10.0.0&id1=214939377531912&t1=click&n1=button&c1=Button%20Button--login&y1=%40div%3B%23application%3B.ic-app%3B%7C%40div%3B%23wrapper%3B.ic-Layout-wrapper%3B%7C%40div%3B%23main%3B.ic-Layout-columns%3B%7C%40div%3B%23not_right_side%3B.ic-app-main-content%3B%7C%40div%3B%23content-wrapper%3B.ic-Layout-contentWrapper%3B%7C%40div%3B%23content%3B.ic-Layout-contentMain%3B%5Brole%3Dmain%5D%3B%7C%40div%3B.ic-Login%3B%7C%40div%3B.ic-Login__container%3B%7C%40div%3B.ic-Login__content%3B%7C%40div%3B.ic-Login__innerContent%3B%7C%40div%3B.ic-Login__body%3B%7C%40form%3B%23login_form%3B%5Baccept-charset%3DUTF-8%5D%3B%5Baction%3D%2Flogin%2Fcanvas%5D%3B%5Bmethod%3Dpost%5D%3B%7C%40div%3B.ic-Login__actions%3B%7C%40div%3B.ic-Form-control%3B.ic-Form-control--login%3B%7C%40button%3B.Button%3B.Button--login%3B%5Btype%3Dsubmit%5D%3B%7C&ts1=1683575911557&ubv1=112.0.5615.139&upv1=10.0.0&id2=1706629188279600&t2=submit&n2=form&i2=login_form&y2=%40div%3B%23application%3B.ic-app%3B%7C%40div%3B%23wrapper%3B.ic-Layout-wrapper%3B%7C%40div%3B%23main%3B.ic-Layout-columns%3B%7C%40div%3B%23not_right_side%3B.ic-app-main-content%3B%7C%40div%3B%23content-wrapper%3B.ic-Layout-contentWrapper%3B%7C%40div%3B%23content%3B.ic-Layout-contentMain%3B%5Brole%3Dmain%5D%3B%7C%40div%3B.ic-Login%3B%7C%40div%3B.ic-Login__container%3B%7C%40div%3B.ic-Login__content%3B%7C%40div%3B.ic-Login__innerContent%3B%7C%40div%3B.ic-Login__body%3B%7C%40form%3B%23login_form%3B%5Baccept-charset%3DUTF-8%5D%3B%5Baction%3D%2Flogin%2Fcanvas%5D%3B%5Bmethod%3Dpost%5D%3B%7C&ts2=1683575911561&ubv2=112.0.5615.139&upv2=10.0.0&st=1683575911596&ei=210&et=variation method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0020] url:https://du11hjcvx0uqb.cloudfront.net/dist/fonts/lato/extended/Lato-Regular-bd03a2cc27.woff2 method:GET err:fetching response body: No data found for resource with given identifier (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0021] url:https://du11hjcvx0uqb.cloudfront.net/dist/fonts/lato/extended/Lato-Bold-cccb897485.woff2 method:GET err:fetching response body: No data found for resource with given identifier (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0021] "Translation for \"If left empty link, text will display as course link name\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Count\" in \"en\" is missing" source=browser-console-api
WARN[0021] url:https://du11hjcvx0uqb.cloudfront.net/dist/fonts/lato/extended/Lato-Italic-4eb103b4d1.woff2 method:GET err:fetching response body: No data found for resource with given identifier (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0021] "Translation for \"Document\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Selection\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Words\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Characters (no spaces)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Characters\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Afrikaans\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Albanian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Arabic\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Belarusian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Bulgarian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Catalan\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Chinese\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Croatian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Czech\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Danish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Dutch\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"English\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Estonian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Filipino\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Finnish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"French\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Galician\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"German\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Greek\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Haitian Creole\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Hindi\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Hungarian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Icelandic\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Indonesian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Irish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Italian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Japanese\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Korean\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Latvian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Lithuanian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Macedonian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Malay\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Maltese\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Norwegian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Persian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Polish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Portuguese\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Romanian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Russian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Serbian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Slovak\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Slovenian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Spanish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Swahili\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Swedish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Tagalog\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Thai\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Turkish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Ukrainian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Vietnamese\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Welsh\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Yiddish\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"English (Canada)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"English (Australia)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"English (United Kingdom)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"French (Canada)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Hebrew\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Armenian\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Māori (New Zealand)\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Norwegian Bokmål\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Norwegian Nynorsk\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Chinese Simplified\" in \"en\" is missing" source=browser-console-api
WARN[0021] "Translation for \"Chinese Traditional\" in \"en\" is missing" source=browser-console-api
WARN[0024] url:https://du11hjcvx0uqb.cloudfront.net/dist/webpack-production/80121-c-a68ff66462.js method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0024] url:https://du11hjcvx0uqb.cloudfront.net/dist/webpack-production/64411-c-a7bc89878b.js method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
WARN[0024] url:https://du11hjcvx0uqb.cloudfront.net/dist/webpack-production/55345-c-385f830c8f.js method:GET err:fetching response body: No resource with given identifier found (-32000) category="Response:bodySize:fetchBody" elapsed="0 ms" goroutine=32
ERRO[0033] communicating with browser: read tcp 127.0.0.1:60717->127.0.0.1:60716: wsarecv: An existing connection was forcibly closed by the
remote host. category=cdp elapsed="0 ms" goroutine=57
ERRO[0034] process with PID 28296 unexpectedly ended: exit status 1 category=browser elapsed="406 ms" goroutine=75
ERRO[0034] cleaning up the user data directory: remove C:\Users\JBELLI~1\AppData\Local\Temp\xk6-browser-data-2772146674\CrashpadMetrics-active.pma: Access is denied. category=browser elapsed="306 ms" goroutine=75
ERRO[0051] Uncaught (in promise) waiting for navigation: timed out after 30s executor=constant-vus scenario=default
browser_dom_content_loaded.......: avg=310.78ms min=166µs med=193.6ms max=1.03s p(90)=728.26ms p(95)=883.49ms
browser_first_contentful_paint...: avg=575.9ms min=239.99ms med=467.82ms max=1.12s p(90)=952.24ms p(95)=1.04s
browser_first_meaningful_paint...: avg=721.85ms min=239.99ms med=759.72ms max=1.12s p(90)=1.12s p(95)=1.12s
browser_first_paint..............: avg=496.01ms min=192.48ms med=542.22ms max=813.52ms p(90)=764.84ms p(95)=789.18ms
browser_loaded...................: avg=664.5ms min=1.96ms med=467.41ms max=2.92s p(90)=1.36s p(95)=2.14s
data_received....................: 17 MB 348 kB/s
data_sent........................: 76 kB 1.5 kB/s
http_req_connecting..............: avg=10.76ms min=0s med=0s max=199ms p(90)=0s p(95)=92ms
http_req_duration................: avg=141.63ms min=112µs med=106.85ms max=1.71s p(90)=279.12ms p(95)=332.7ms
http_req_receiving...............: avg=42.28ms min=0s med=25ms max=194ms p(90)=107ms p(95)=119ms
http_req_sending.................: avg=310.55µs min=0s med=0s max=5ms p(90)=1ms p(95)=2ms
http_req_tls_handshaking.........: avg=8.89ms min=0s med=0s max=185ms p(90)=0s p(95)=74ms
http_reqs........................: 161 3.272746/s
iteration_duration...............: avg=49.19s min=49.19s med=49.19s max=49.19s p(90)=49.19s p(95)=49.19s
iterations.......................: 1 0.020328/s
vus..............................: 1 min=1 max=1
vus_max..........................: 1 min=1 max=1
running (0m49.2s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs 30s
Is there anyway we can run the script against the website you are testing against? Or can you replicate this behaviour with a publicly accessible website?
This looks suspicious, and it might be referring to:
Specifically page.waitForNavigation(), which would signal that the test is timing out waiting for the selector input[value="Authorize"]. Are you sure that there is an input element on the page where the value attribute is Authorize?
Thanks again @ankur !
This site is written in node.js/react and uses a 3rd party auth service which I don’t have shareable credentials for, so that makes providing access to it problematic. I am not aware of any similar publicly available web sites, otherwise that seems like a good route to take.
I have tried a number of things with the code block you have mentioned. I am sure (from examining the page) that is has an input where the value is “Authorize”. Also, if I test by removing that selector, the test stops there.
If I remove the page.waitForNavigation() then the test does seem to try to continue. In this case:
with a page.goto....the error that results is ERRO[0054] Uncaught (in promise) navigating frame to [new page].
If I try to action another selector, the result is: ERRO[0029] Uncaught (in promise) GoError: clicking on "a[href=\"/activity/103/1483\"]": execution context changed; most likely because of a navigation
The navigation error above is puzzling, since the code block that follows is:
Could you copy a portion of html content which contains the Authorize input?
These are the possibilities that come to mind that could be the cause of the issue:
Click on Authorize doesn’t navigate to a new page. Although it looks like it may do based on the errors you’ve posted in your last comment.
The Authorize input is in an iframe element or shadow dom. With iframe, there’s no solution unfortunately. With shadow doms there’s a work around which is listed in this issue. Although, again, based on the errors it seems that that’s not the issue since it does navigate when page.waitForNavigation() is removed.
There’s an issue with page.waitForNavigation(), but we won’t be able to do much unless we can replicate it with a page similar to what you are testing against.