It is possible to automate a test which selects a file from your computer and upload it online? I tried to scan the windows of my computer which show when you click the upload button online but it seems it is not possible.
7 Answers, 1 is accepted
Thank you for posting in Test Studio forum.
Test Studio automatically detects dialogs and handles these - here you could find further details on the feature.
Could you please tell or explain how to use FileUploadDialog in code for - WPF Desktop application? I can't find a hint of how to use it with WPF Desktop applications, only for Web Browsers instructions are presented.
I am sorry to hear you are facing any troubles with the dialogs for WPF application when working in code. I reviewed our documentation and noticed that we have missed to include such an article, so I will take care to update this as soon as possible.
Apart from this, I have to mention that the WPF dialog handlers are different than these you found for web apps. These are named SaveFile dialog and OpenFile dialog and here is a sample for the code to implement:
//add OpenFile dialog ArtOfTest.WebAii.Win32.Dialogs.OpenFileDialog.CreateOpenFileDialog wpfOpenDialog = ArtOfTest.WebAii.Win32.Dialogs.OpenFileDialog.CreateOpenFileDialog(ActiveApplication, DialogButton.OPEN, @"d:\name"); Manager.DialogMonitor.AddDialog(wpfOpenDialog); Manager.DialogMonitor.Start(); //trigger action to show dialog // your code here //hande SaveAs dialog wpfOpenDialog.WaitUntilHandled(15000); Manager.DialogMonitor.RemoveDialog(wpfOpenDialog);
Please, give it a try and let me know if you need any further assistance on the topic. Thank you for your cooperation in advance.
Thanks a lot for Help and quick answer. It works !!!
I am pleased to know that this suggestion resolved your doubts.
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
One note for code which you sent me above.
Works for me with small changes, need to add to Manager.Current and then DialogMonitor
Thanks for the note. These seem to be specifics for the project you work in and how this is organized. Anyways, I am glad that you managed to adjust the code as per your needs.