Skip to content
New issue

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

Cannot SwitchTo or Close specified tab #841

Closed
adea11 opened this issue Sep 27, 2019 · 8 comments
Closed

Cannot SwitchTo or Close specified tab #841

adea11 opened this issue Sep 27, 2019 · 8 comments
Assignees

Comments

@adea11
Copy link

adea11 commented Sep 27, 2019

Expected behavior

Should switchTo previous tab when specified
Should close a previous tab when specified tab

Actual behavior

TypeError: Cannot read property 'split' of null

Steps to reproduce

  1. OpenTab tab yahoomail.com
  2. OpenTab gitHub.com
  3. switchTo yahoomail.com (await switchTo('https://login.yahoo.com')
  4. closeTab yahoomail.com (await closeTab('https://login.yahoo.com')

Versions

Gauge version: 1.0.6

Taiko Version: 1.0.0 (Chromium: 76.0.3803.0) RELEASE
[switchTo.zip](https://github.com/getgauge/taiko/files/3661689/switchTo.zip)



Plugins
-------
flash (0.0.1)
html-report (4.0.8)
js (2.3.5)
json-report (0.3.1)
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.1)

@adea11
Copy link
Author

adea11 commented Sep 27, 2019

switchTo.zip

@adea11
Copy link
Author

adea11 commented Sep 27, 2019

switchTo.zip

Sample project attached

@BugDiver
Copy link
Member

@adea11 Thanks for reporting this. We are able to replicate it. We will be pushing a fix soon.

Note

Here is a sample script to replicate the issue.

const { openBrowser, openTab, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser();
        await openTab('https://login.yahoo.com');
        await openTab('https://github.com/getgauge');
        await switchTo('https://login.yahoo.com')
    } catch (error) {
        console.error(error);
    } finally {
        await closeBrowser();
    }
})();

@adea11
Copy link
Author

adea11 commented Sep 27, 2019

Thanks @BugDiver,
this also occur when closing a tab with url. Example: await closeTab('https://login.yahoo.com')

@adea11
Copy link
Author

adea11 commented Sep 27, 2019

@adea11 Thanks for reporting this. We are able to replicate it. We will be pushing a fix soon.

Note

Here is a sample script to replicate the issue.

const { openBrowser, openTab, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser();
        await openTab('https://login.yahoo.com');
        await openTab('https://github.com/getgauge');
        await switchTo('https://login.yahoo.com')
    } catch (error) {
        console.error(error);
    } finally {
        await closeBrowser();
    }
})();

Thanks @BugDiver,
this also occur when closing a tab with url. Example: await closeTab('https://login.yahoo.com')

@shubhamsc shubhamsc self-assigned this Sep 30, 2019
@Debashis9012
Copy link
Contributor

If the active browser having a tab without any url we are able to perform switchTo and closeTab actions successfully.
This issue has been verified and found fixed.
Tested version:
Version: 1.0.2 (Chromium: 76.0.3803.0) 22a7d58c629864e04042d4661046d0c3e8e802cd

@adea11
Copy link
Author

adea11 commented Sep 30, 2019

If the active browser having a tab without any url we are able to perform switchTo and closeTab actions successfully.
This issue has been verified and found fixed.
Tested version:
Version: 1.0.2 (Chromium: 76.0.3803.0) 22a7d58c629864e04042d4661046d0c3e8e802cd

@Debashis9012 When will this version 1.0.2 be available please

@Debashis9012
Copy link
Contributor

@adea11 we are working on version 1.0.2 to release it soon till then you can use commit 22a7d58c629864e04042d4661046d0c3e8e802cd .

you can install the fix version: npm install git+https://github.com/getgauge/taiko.git#22a7d58c629864e04042d4661046d0c3e8e802cd -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants