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

In nativeAutomation, setFileUpload does nothing #7832

Closed
tandreys opened this issue Jun 26, 2023 · 2 comments
Closed

In nativeAutomation, setFileUpload does nothing #7832

tandreys opened this issue Jun 26, 2023 · 2 comments
Assignees
Labels
FREQUENCY: level 1 SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).

Comments

@tandreys
Copy link

What is your Scenario?

Scenario need to upload a file

What is the Current behavior?

await t.setFileUpload does nothing

What is the Expected behavior?

await t.setFileUpload sets the file to upload

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

https://www.htmlquick.com/reference/tags/input-file.html

What is your TestCafe test code?

import { Selector } from 'testcafe';

fixture Sandbox
test('fileinput', async t =>{
await t.navigateTo("https://www.htmlquick.com/reference/tags/input-file.html");

await t.maximizeWindow();

var input = "[name='uploadedfile']";
await t.setFilesToUpload(input, "C:\\Windows\\win.ini");
await t.expect (Selector(input).value).contains("win.ini")
//await t.click('[value="Send data"]');
//await t.expect(Selector('caption').innerText).contains('Uploaded files');
await t.debug();

})

Your complete configuration file

"skipJsErrors": true,

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

I have the same issue on a server that I cannot share so I tried to find a public website to reproduce.
Here the sendData is failing because of target='blank' under nativeAutomation so I just check the value of the input.
Running with nativeAutomation, the input is not set.
With the option --disable-native-automation , test is passing

TestCafe version

3.0.0

Node.js version

18.16.0 and 16.19.2

Command-line arguments

--disable-multiple-windows

Browser name(s) and version(s)

chrome

Platform(s) and version(s)

Windows 11, Ubuntu 20

Other

No response

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

Hello. I managed to reproduce the problematic behavior. It occurs due to multiple issues:

  1. The value of an input element is not set in Native Automation mode
  2. New page is open after form submitting. Currently, the Native Automation mode does not allow you to run tests in multiple windows.
    While we can research the first issue, the second one is a limitation of the Native Automation mode.
  3. It looks like --disable-multiple-windows works incorrectly in Native Automation mode. We'll research this behavior.

We recommend using --disable-native-automation until issues 1 and 3 are fixed.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 28, 2023
@miherlosev miherlosev self-assigned this Jun 29, 2023
miherlosev added a commit to miherlosev/testcafe that referenced this issue Jun 29, 2023
miherlosev added a commit that referenced this issue Jun 30, 2023
Changes:
* fix incorrect `HTMLFileInput.value` value
@miherlosev
Copy link
Collaborator

Hi @tandreys,

The value of an input element is not set in Native Automation mode

This issue was fixed in this PR - #7841.

Other issues are related to the Support using multiple windows in the native automation mode feature. So, I will close this issue in favor of #7661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 1 SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants