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

Support multiple windows in native automation mode #7661

Open
Dmitry-Ostashev opened this issue Apr 26, 2023 · 18 comments
Open

Support multiple windows in native automation mode #7661

Dmitry-Ostashev opened this issue Apr 26, 2023 · 18 comments
Labels

Comments

@Dmitry-Ostashev
Copy link
Contributor

Dmitry-Ostashev commented Apr 26, 2023

What is your Scenario?

At present, TestCafe does not support multiple windows in native automation mode.

What are you suggesting?

Support multiple windows in native automation mode.

@Dmitry-Ostashev Dmitry-Ostashev changed the title Support multiple windows in the native automation mode Support multiple windows in native automation mode Apr 26, 2023
@tsherkqa
Copy link

tsherkqa commented May 4, 2023

Thank you for opening this ticket - our team is looking for support of multiple windows in native mode too. Clicking links that open new pop out windows is something we need to cover, so we can't turn this on for every test yet.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 4, 2023
@aleks-pro aleks-pro removed the STATE: Need response An issue that requires a response or attention from the team. label May 5, 2023
@patrickathompson
Copy link

same or similar issue:

The application under test is programmed to open a new window or tab when a button is clicked. We need support for this type of interaction in TestCafe, because the application under test cannot always be modified to open in the same window.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 22, 2023
@Dmitry-Ostashev Dmitry-Ostashev removed the STATE: Need response An issue that requires a response or attention from the team. label May 23, 2023
@vlad-dargel
Copy link

The same problem. We have many tests with multiple windows, and native automation mode doesn't work with them.

@Jgrabenbauer
Copy link

Are there any workarounds with this @aleks-pro ? Or maybe at least to exclude certain tests from using native automation?

Thanks!

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 19, 2023
@Aleksey28
Copy link
Collaborator

Hi @Jgrabenbauer,

You can create two separate test runs - in Native Automation mode and without it. Specify test paths with the glob pattern as follows: Test files. Use the --disable-native-automation option for this purpose.

Run tests with NA:

testcafe chrome "tests/**/*" "!tests/multiple-tests/**/*"

Run tests without NA:

testcafe chrome "tests/multiple-tests/**/*" --disable-native-automation

You can do the same with configuration files or with a Runner object. Also, you can filter tests by metadata.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 20, 2023
@aleks-pro
Copy link
Collaborator

@abdul-florez
Copy link

I have to work around particular situations, removing the target attribute with clientFunction and then clicking the element.

ClientFunction((locator) => {
            const element = document.querySelector(locator);
            element.removeAttribute("target");
});

Also, I had to use the "navigate()" function after getting the link from any attribute or API for those redirections that don't happen with an anchor tag and target attribute.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Aug 14, 2023
@miherlosev miherlosev removed the STATE: Need response An issue that requires a response or attention from the team. label Aug 16, 2023
@gforepsly
Copy link

gforepsly commented Aug 23, 2023

We have the same issue - there is no workaround, 1 test is part of a larger group where we need to combine native and not native automation modes to avoid this bug
Any ETA when this can be fixed/supported? It's a really nasty issue and a blocker for us.

Just to add - the issue happens when click on a link happens, which opens a new target window (tab). The step fails, and the report in json is not even created for us, this is not handled well.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Aug 23, 2023
@Aleksey28
Copy link
Collaborator

Hi @gforepsly,

We supported the --disable-multiple-windows option in Native Automation mode, and it's already published in TestCafe 3.3.0-rc.1. Please test it.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Aug 24, 2023
@tandreys
Copy link

Is there an option to ignore popup window? I have an auto-closing popup, with proxy mode I just add a small t.wait, but in native mode Testcafe disable popup

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 14, 2023
@AlexKamaev
Copy link
Contributor

Could you elaborate on what you mean by popup window? Do you mean a real browser window or just some kind of DOM element with a fixed/absolute position? Please share a simple reproducible sample to demonstrate what kind of popup you have.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 15, 2023
@tandreys
Copy link

I mean a real window that process authentication on remote system. I don't have access to the real code but it's something like the js below where instead of opening a website yahoo, it's open a auth.html page
...
var myWindow = window.open('http://www.yahoo.com','1366002941508','width=600,height=400,left=5,top=3')
setTimeout(function() { myWindow.close();}, 3000);

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 15, 2023
@AlexKamaev
Copy link
Contributor

@tandreys
In this case, the only workaround is to use the --disable-native-automation option to disable the Native Automation mode.

@Bayheck
Copy link
Collaborator

Bayheck commented Dec 29, 2023

Testcafe released a new version v3.5.0.
The experimental CLI flag ‘--experimental-multiple-windows’ allows multiple-window tests with native automation. Please try this solution and let us know if you encounter any issues.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Dec 29, 2023
@Aleksey28 Aleksey28 removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 2, 2024
@mx-bernhard
Copy link

I have a RequestLogger in my test that expects a certain request to have been logged for the newly opened window. Unfortunately, it seems that all requests from the new window are not recorded with the RequestLogger, just the ones from the initial window. Is this still unsupported in 3.5.0?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 17, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Jan 18, 2024

Hello,

Multiple windows mode with native automation is still an experimental feature.
Thank you for your feedback. We will take it into account.

@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 22, 2024
@juan-garces
Copy link

juan-garces commented Feb 1, 2024

I have a similar problem as @mx-bernhard. Any action unrelated the main window, i.e. if you open a new tab or window after clicking a button or resizing the browser window and then perform a validation in a same test, those actions are blocking all suite execution. It's a structural problem because if you have a test that performs any of these actions it completely freezes the execution and does not allow to launch any report. At the moment it's evident in local regression executions and in GitHub Actions executions

@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 1, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Feb 5, 2024

Hello @juan-garces @mx-bernhard ,
Please create a separate ticket based on this template and also share a minimal working example in that ticket so that the TestCafe team can research the issue and help you.

@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests