DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 673 forks source link

Exception occurs only through TestCafe, executing manually or through other autmation tool looks good #7686

Closed aprabh001c closed 1 year ago

aprabh001c commented 1 year ago

What is your Scenario?

  1. Launch https://www.xfinity.com/learn/offers
  2. Search with a valid address
  3. Select an offer Expected: - No exception should be given Actual:- Something went wrong error shown, but manually or running through other automation tools it looks fine

Script:

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,"1800 ARCH ST, APT C1230, PHILADELPHIA, PA 19103",{paste:true})
await t.debug()
await t.click(Selector('main span').withText('1800 ARCH ST, APT C1230, PHILADELPHIA, PA 19103'))
await t.click(Selector('[class="localization-container"] button[type="submit"]'))
await t.wait(2000)
await t.click(Selector('footer button').withText('View Deals'))
await t.click(Selector('[alt="add-icon"]'))
await t.click(Selector('[name="INTERNET"]~label'))
})

Note: - Tried to record video using --video command but it ended up with blank white screen Downloaded FFMEG and set as env variable as well, but it didnt help image + image

What is the Current behavior?

image

What is the Expected behavior?

No exception should be given

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=>{
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,"1800 ARCH ST, APT C1230, PHILADELPHIA, PA 19103",{paste:true})
await t.debug()
await t.click(Selector('main span').withText('1800 ARCH ST, APT C1230, PHILADELPHIA, PA 19103'))
await t.click(Selector('[class="localization-container"] button[type="submit"]'))
await t.wait(2000)
await t.click(Selector('footer button').withText('View Deals'))
await t.click(Selector('[alt="add-icon"]'))
await t.click(Selector('[name="INTERNET"]~label'))
})

Your complete configuration file

npx testcafe chrome testing.js -e --native-automation

Your complete test report

No response

Screenshots

image

Steps to Reproduce

  1. Launch https://www.xfinity.com/learn/offers
  2. Search with a valid address
  3. Select an offer

TestCafe version

2.5.1-rc.1

Node.js version

18.16.0

Command-line arguments

npx testcafe chrome testing.js -e --native-automation

Browser name(s) and version(s)

Chrome 113.0.5672.64

Platform(s) and version(s)

windows 2016 server

Other

No response

aleks-pro commented 1 year ago

Hello @aprabh001c ,

Thank you for sharing the test code. I did not manage to reproduce the issue. Please check the attached screencast:

https://github.com/DevExpress/testcafe/assets/14822473/1b009477-f5c7-490a-883f-e828b5262d46

I tried to reproduce it in the attached project sample. You can run it by using the following commands:

npm ci
npx testcafe chrome ./tests/test.js -e --native-automation

i7686.zip

Please modify the project sample so that we can reproduce the problematic behavior on our side.

aprabh001c commented 1 year ago

Hi even in attached video provided as part of your reply, you can see the error message after selecting the block. Below error message doesnt occur if you do same steps manually. image

aleks-pro commented 1 year ago

Hi @aprabh001c ,

I see the problematic behavior now. Thank you for reporting the issue. We will look into it and update this thread once we have any results. In the meantime, as a workaround, you can disable the Native Automation mode.

aprabh001c commented 1 year ago

Thanks for looking into it, with Native Automation Off, we always hit below error at end of script (issue raised for same https://github.com/DevExpress/testcafe/issues/6861 )

× UnhandledExceptionTC

1) Uncaught exception:

  Error: Session closed with error code 11
  at new NodeError (node:internal/errors:399:5)
  at Http2Session.onGoawayData (node:internal/http2/core:687:21)
  at Http2Session.callbackTrampoline (node:internal/async_hooks:130:17)
aprabh001c commented 1 year ago

Thank you for fixing this. Please let me know which version I can expect this fix.

On Tue, May 16, 2023 at 9:48 PM Mikhail Losev @.***> wrote:

Closed #7686 https://github.com/DevExpress/testcafe/issues/7686 as completed via DevExpress/testcafe-hammerhead#2890 https://github.com/DevExpress/testcafe-hammerhead/pull/2890.

— Reply to this email directly, view it on GitHub https://github.com/DevExpress/testcafe/issues/7686#event-9263824064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN24BXMR25WWF34WCQLIMX3XGQU7HANCNFSM6AAAAAAX2MIHAQ . You are receiving this because you were mentioned.Message ID: @.***>

Aleksey28 commented 1 year ago

Hi @aprabh001c,

We will introduce this fix in the upcoming version.