Adding a local file to a test.

1 Answer 27 Views
Test Recording
Jim
Top achievements
Rank 1
Iron
Jim asked on 07 Nov 2023, 02:19 PM
I'd like to create an automated test which requires either dragging and dropping a local file, or opening Windows Explorer and choosing a local file.
Can this be done in Test Studio?

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 08 Nov 2023, 04:08 PM

Hi Jim,

In the context of web testing the drag and drop action is limited to the browser area. With that said it is not a supported scenario out-of-the-box to validate if dropping an external file is dropped in the upload area. Instead, you can use the upload button to trigger the Upload dialog and handle it. 

Apart from that and because you are using the latest Test Studio version I want to share another possible solution - it is available since we released the Desktop feature last year. This type of testing allows you to interact with all objects visible on the desktop and the good news is that such actions can be invoked in between the web test scenario. You can explore this article which demoes the capabilities of desktop testing. It uses a sample desktop app, but you can actually use all objects on the desktop. You need to ensure what will be visible on the screen during the test run. 

I hope this will be helpful for you. 

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Jim
Top achievements
Rank 1
Iron
commented on 08 Nov 2023, 04:59 PM

For your first paragraph , I added the FileUpload step. It looks like this:

The complete path is:
C:\Users\JBailey\OneDrive - Madison Resource Funding Corp\Desktop\Upload.docx

I have no idea how to make it work. When I run the step it times out. 

I found very little documentation online other than this:
https://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/advanced-topics-wtc/html-popups-and-dialogs-wtc/file-upload-dialog

So, is this a coded step or should the 'regular' Test Studio handle it? Or it is a combination?

Jim
Top achievements
Rank 1
Iron
commented on 08 Nov 2023, 06:17 PM

Ok, I did some experimenting and got it to work.
All set on this. I'll take a look at your second suggestion next.

 

Elena
Telerik team
commented on 10 Nov 2023, 01:04 PM

Hi Jim, 

I am glad to know you managed to adjust the file upload scenario. It requires an action which brings up the upload dialog. Then the 'Handle Upload' step. 

I just want to add that article you referred describes how to handle the dialog in code. This is not needed for this case as you confirmed that the test is set. 

Thank you for your cooperation.

Regards,
Elena

Tags
Test Recording
Asked by
Jim
Top achievements
Rank 1
Iron
Answers by
Elena
Telerik team
Share this question
or