Open ankur-lt opened 1 year ago
The following WS message is received from browser in case of headless browser, which thus leads to a retry.
"{\"id\":1,\"result\":{\"targetInfos\":[]}}"
@zabil , @saikrishna321 , can you check this?
The first CDP command send to browser is:
{"id":1,"method":"Target.getTargets","params":{}}
Shouldn't we first create target using {"method":"Target.createTarget","params":{"url":"about:blank"},"id":5}
, the way Puppeteer does it and then send the Target.getTargets
message?
Although, as per I checked, the targets are already created for Chrome <110 without having to explicitly create targets.
Yes taiko tries to use the existing tab, may be the behaviour is changed now with the latest version of the browser. We will have to revisit this.
Describe the bug I am launching Chrome browser and passing its WS URL in the target. Refer the taiko plugin: https://www.npmjs.com/package/taiko-lambdatest When launching Chrome >= 110 with the ALI arg
--headed
, the chrome-remote-interface keeps on calling the/json/protocol
API when though the response is 200. Command used:I compared the response of the API
GET /json/protocol
for Chrome with headed and headless mode, but the response was the same. The library keeps on callingGET /json/protocol
even though the response is valid and thus doesn't start the test.To Reproduce Steps (or script) to reproduce the behavior in local:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --headless
on MacOS or on other OS with appropriate path.openBrowser()
function.Expected behavior The test should launch and get executed.
Versions:
Additional context I am trying to launch the browser with the provided CLI args and then pass the WS URL in the target. I add previously raised this PR: https://github.com/getgauge/taiko/pull/2380 to add support of running taiko tests on remote machines. The above code I have added is to reproduce the scenario in local. It works as expected with headed mode on all chrome versions. Its giving the above issue for chrome and edge >=110. When I tried setting
TAIKO_BROWSER_PATH=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
start the test with the belowopenBrowser()
function:the test works as expected. Although, I am not being able to check the CLI args passed by taiko in this case as
chrome://version
isn't allowed in headless mode.