I'm trying to upload a file to the site I'm testing (Using Chrome) with Testcafe. Below is my code so far,
await t
.setFilesToUpload(Selector('input.btn.btn-link.d-none'), file_path)
await t
.setNativeDialogHandler(() => true)
.click('#Ok');
Once I try to upload the file, browser pops up a native dialog window, my options are "Open" / "Cancel". How do I click "Open" ? Also I don't know how to get the Selector for Open button.
I'm running this on Linux, Java Script. Below is the error,
1) The specified selector does not match any element in the DOM tree.
> | Selector('#Open')
Browser: HeadlessChrome 78.0.3904 / Linux 0.0.0
Screenshot: /app/code/screenshots/2019-12-11_22-28-52/test-2/HeadlessChrome_78.0.3904_Linux_0.0.0/errors/1.png
71 | //.handleAlert().click()
72 | //.click('#Open');
73 |
74 | await t
75 | .setNativeDialogHandler(() => true)
> 76 | .click('#Open');
77 |
78 | const history = await t.getNativeDialogHistory();
79 | await console.log(history);
80 | }
81 |}
at <anonymous> (/app/code/gen_lib/gen_lib.js:76:24)