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

Assertion Failure Is throwing Uncaught exception #6861

Closed
aprabh001c opened this issue Feb 10, 2022 · 6 comments
Closed

Assertion Failure Is throwing Uncaught exception #6861

aprabh001c opened this issue Feb 10, 2022 · 6 comments

Comments

@aprabh001c
Copy link

What is your Scenario?

When TestCase fail due to assertion, it throws an uncaught exception, sometime it leads to testcase termination. Which is affecting automated run. I have tried to replicate this issue in a public website. Please refer details in respective sections

What is the Current behavior?

  1. AssertionError: expected false to be truthy

    Browser: Chrome 97.0.4692.99 / Windows 10

      4 |fixture `UnHandledException`
      5 |
      6 |test(`UnhandledExceptionTC`, async tn=>{
      7 |    await t.navigateTo("https://www.xfinity.com/learn/offers");
      8 |    await t.wait(10000);
    

    9 | await t.expect(Selector('#localization-address-fieldJunk').visible).ok()
    10 |})

     at <anonymous> (C:\Users\xxxxxxx\unexpected.js:9:73)
     at asyncGeneratorStep (C:\Users\xxxxx\unexpected.js:1:259)
     at _next (C:\Users\xxxxx\unexpected.js:1:597)
    
  2. Uncaught exception:

    Error [ERR_HTTP2_SESSION_ERROR]: Session closed with error code 11
    at Http2Session.onGoawayData (internal/http2/core.js:649:21)
    at Http2Session.callbackTrampoline (internal/async_hooks.js:134:14)

    Browser: Chrome 97.0.4692.99 / Windows 10

TestCafe Version - 1.18.2
Node Version - v14.17.0

What is the Expected behavior?

Test should fail without any exception.

What is your public website URL? (or attach your complete example)

https://www.xfinity.com/learn/offers

What is your TestCafe test code?

import {t, Selector} from 'testcafe'

fixture UnHandledException

test(UnhandledExceptionTC, async tn=>{
await t.navigateTo("https://www.xfinity.com/learn/offers");
await t.wait(10000);
await t.expect(Selector('#localization-address-fieldJunk').visible).ok()
})

Your complete configuration file

No response

Your complete test report

No response

Screenshots

  1. Uncaught exception:

    Error [ERR_HTTP2_SESSION_ERROR]: Session closed with error code 11
    at Http2Session.onGoawayData (internal/http2/core.js:649:21)
    at Http2Session.callbackTrampoline (internal/async_hooks.js:134:14)

    Browser: Chrome 97.0.4692.99 / Windows 10

Steps to Reproduce

TestCafe version

1.18.2

Node.js version

v14.17.0

Command-line arguments

testcafe chrome -F UnHandledException

Browser name(s) and version(s)

Chrome 97.0.4692.99

Platform(s) and version(s)

Windows 10

Other

No response

@aprabh001c aprabh001c added the TYPE: bug The described behavior is considered as wrong (bug). label Feb 10, 2022
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 10, 2022
@AlexKamaev
Copy link
Contributor

Thank you for reporting this. I was able to reproduce the issue.
For the team:
I was able to reproduce it with the testcafe-hammerhead playground.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 10, 2022
@nvindraneel4
Copy link

Hi, I am running into a similar issue, can someone please provide me a solution here. Thank you.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 10, 2022
@AlexKamaev AlexKamaev added the STATE: No workarounds No workarounds are available at this point. label Feb 11, 2022
@github-actions
Copy link

There are no workarounds. Once we get any updates, we will post them in this thread.

@github-actions github-actions bot removed STATE: Need response An issue that requires a response or attention from the team. STATE: No workarounds No workarounds are available at this point. labels Feb 11, 2022
@miherlosev
Copy link
Collaborator

miherlosev commented Dec 6, 2022

Hi @aprabh001c,

TestCafe runs tests using the URL-rewritten proxy.
This approach is good. However, there is a way to improve the stability and speed of test execution - the native browser automation API.
We have a test execution mode uses native browser automation - we call it the Proxyless mode.
In Proxyless mode, a few issues are already fixed.
By the way, this issue was also fixed in Proxyless mode.
Try running your tests in Proxyless mode and let us know the results.
This option is available in all interfaces:

// Command-line
testcafe chrome tests --experimental-proxyless

// Programmatic
const testcafe = await createTestCafe({ experimentalProxyless: true });
	
// Configuration file
{
   "experimentalProxyless": "true"
}	

Note that at present it is an experimental mode.
Also, the Proxyless mode is implemented only in Google Chrome. It will not work correctly if you run tests in a non-Chrome browser or in a combination of other browsers.

@aprabh001c
Copy link
Author

Node Version - 19.3.0
TestCafe Version - 2.3.0
Browser - Chrome

When experimentalProxyless=true, testcafe is not clicking _search button( or after clicking browser is not responding) and it fails

Script Used to reproduce with Public Website
import {t, Selector} from 'testcafe'

fixture UnHandledException

test(UnhandledExceptionTC, async tn=>{
const _addressField = Selector('#Address_SingleStreetAddress,input[name="localizationAddressField"]');
const _search = Selector(".localization-container button[type='submit']");

await t.navigateTo("https://www.xfinity.com/learn/offers");
await t.wait(10000);
await t.typeText(_addressField,"200 MAIN ST, NORTHAMPTON, MA 01060",{paste:true})
await t.wait(2000)
await t.click(_search)
await t.expect(_search.visible).notOk();

})

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 23, 2023
@Artem-Babich Artem-Babich removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 24, 2023
@miherlosev
Copy link
Collaborator

Hi @aprabh001c,

This issue is not reproduced with combination of testcafe@3.0.1 and the Google Chrome browser. Feel free to reopen this issue if you encounter it in other browsers.

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

No branches or pull requests

5 participants