Hello,
I am using K6 browser module to run a coded UI test of a webpage. The page includes an element and I would like the script to select a file to upload. Is this possible? I have tried the following approaches but I receive error messages in each case:
Is there a way of setting the file on an element using the K6 browser module?
Note: I don’t want to test this using lower level POST calls as I am using a framework to handle the uploading of files from the browser to the server.
Hi @bandorko,
somehow this solution does not work for my application. No errors, just the file (a pdf) doesn’t get uploaded.
I was wondering when will your changes from 1097 be available for use. Basically can we expect the release in Jan, we are eagerly waiting for it and its kind of a blocker for us.
In some cases these dispatchEvent calls are needed. If it is not a solution for you, then please share the html source with me for further investigation.
Hi, this feature will be available (at least for ElementHandle) when we ship this PR from @bandorko. We aim to merge it for the next version. However, the PR is being reviewed, and the timeline is unclear. But soon!
I am using the k6 browser module and want my script to upload a file. I used the method provided, and while it worked without any errors, I noticed that no file was attached in the front-end application. From my understanding, this method creates a file with the specified name and content. However, I need to upload a file directly from the file system to simulate real user traffic performance. Could you please suggest an alternative method for this.