Taiko: Error: No target with given id found

Created on 11 Dec 2020  路  3Comments  路  Source: getgauge/taiko

Describe the bug
Close the first tab of new incognito session and then close the incognito window causes Error: No target with given id found

To Reproduce

(async () => {
    try {
        await openBrowser();
        await openIncognitoWindow({name:'admin'});
        await goto("google.com");
        await openTab("gauge.org");
        await closeTab(/Google/);
        await closeIncognitoWindow('admin');
    } catch (error) {
        console.error(error);
    } finally {
        await closeBrowser();
    }
})();

Logs

'Error: No target with given id found
' +
  '    at /Users/.../go/src/github.com/getgauge/taiko/node_modules/chrome-remote-interface/lib/chrome.js:93:35
' +
  '    at Chrome._handleMessage (/Users/.../go/src/github.com/getgauge/taiko/node_modules/chrome-remote-interface/lib/chrome.js:256:17)
' +
  '    at WebSocket.<anonymous> (/Users/.../go/src/github.com/getgauge/taiko/node_modules/chrome-remote-interface/lib/chrome.js:234:22)
' +
  '    at WebSocket.emit (events.js:314:20)
' +
  '    at WebSocket.EventEmitter.emit (domain.js:548:15)
' +
  '    at Receiver.receiverOnMessage (/Users/.../go/src/github.com/getgauge/taiko/node_modules/ws/lib/websocket.js:800:20)
' +
  '    at Receiver.emit (events.js:314:20)
' +
  '    at Receiver.EventEmitter.emit (domain.js:548:15)
' +
  '    at Receiver.dataMessage (/Users/..../go/src/github.com/getgauge/taiko/node_modules/ws/lib/receiver.js:436:14)
' +
  '    at /Users/.../go/src/github.com/getgauge/taiko/node_modules/ws/lib/receiver.js:393:23'

Expected behavior
Should close the incognito window without error.

Versions:

  • Taiko: Version: 1.1.0 (Chromium: 88.0.4314.0)
bug

Most helpful comment

Hi @NivedhaSenthil
I would like to work on this issue

All 3 comments

Hi @NivedhaSenthil
I would like to work on this issue

Awesome @athiramanu - please shout out if you need anything

I have raised a draft PR. Could someone please confirm whether the approach is okay?
Also, the unit test seemed to be failing on using the null coalescing operator. When this was replaced by a conditional operator, the tests passed. Is there any reason for the same?

Was this page helpful?
0 / 5 - 0 ratings