You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to run examples/hosts.js and it should not be able to navigate to test.k6.io since the hosts option has been used so that test.k6.io resolves to 127.0.0.254. This is the expected behaviour when working with this example file.
If we change the script so that it connects to an already browser instance, then the browser will resolve to the actual test.k6.io ip address, and not to 127.0.0.254, which is the incorrect behaviour for this example file.
The reason the behaviour is incorrect when testing on an already running browser instance, is because the k6 hosts option in k6-browser uses Chromium's --host-resolver-rules in the background to resolve hosts to a given IP. If the browser is already running then how can we inject this rule?
Researching about how to block a blacklist through CDP, I found the Fetchdomain, which probably would allows us to implement the "hosts" functionality with an already launched browser, although the development "cost" is higher than just specifying a flag on startup.
Brief summary
Try to run
examples/hosts.js
and it should not be able to navigate totest.k6.io
since thehosts
option has been used so thattest.k6.io
resolves to127.0.0.254
. This is the expected behaviour when working with this example file.If we change the script so that it
connect
s to an already browser instance, then the browser will resolve to the actualtest.k6.io
ip address, and not to127.0.0.254
, which is the incorrect behaviour for this example file.The reason the behaviour is incorrect when testing on an already running browser instance, is because the k6
hosts
option ink6-browser
uses Chromium's--host-resolver-rules
in the background to resolve hosts to a given IP. If the browser is already running then how can we inject this rule?xk6-browser version
48ee41a
OS
NA
Chrome version
Version 110.0.5481.177 (Official Build) (arm64)
Docker version and image (if applicable)
NA
Steps to reproduce the problem
examples/hosts.js
file toconnect
to the running browser instance from the previous step.examples/hosts.js
file.Expected behaviour
The test should pass since
test.k6.io
resolves to127.0.0.254
.Actual behaviour
The test fails since it resolves to the actual IP address of
test.k6.io
.The text was updated successfully, but these errors were encountered: