Hi,
I was recording some steps that include upload a document from my computer.
There is a way to record when I select the document from my computer? (See the attachment)
thanks,
5 Answers, 1 is accepted
An Upload Dialog handler step should have automatically been added to the test when you recorded interacting with that dialog. If not, you can manually add one from the Dialogs button in the toolbar.
If that still doesn't work, it may be an issue with the title of the dialog. Notice it says "Open" and not "Choose File to Upload" as seen in a screen shot in the above link. In that case, you'll have to resort to handling the dialog in code. You will need to delete the Handle File Upload test step because implementing it in code will actually conflict with a non-coded dialog handler of the same type.
See the code sample below. Please note you will need to put in code the action that clicks the "Browse" button (or whatever the button is labeled that launches the Open File dialog).
// Initialize and activate a Handle FileUpload dialog handler
FileUploadDialog dlg =
new
FileUploadDialog(ActiveBrowser, @
"C:\test.txt"
, DialogButton.OPEN,
"Open"
);
Manager.DialogMonitor.AddDialog(dlg);
// Click the button that causes the Open File dialog to launch
//(insert code here)
// Wait up to 10 seconds for the dialog to be handled, then deactivate the dialog handler
// to create and use a new one later in the test if needed.
dlg.WaitUntilHandled(10000);
Manager.DialogMonitor.RemoveDialog(dlg);
Regards,
Anthony
the Telerik team
Hi Thanks for the answer,
I used the new features for download and upload, with the dialogs, and works very nice!
if play the record the file attachment is not automatically, I have to add manually.
how can add automatically file in a test with test studio?
You are referring to a thread which dates back almost 7 years ago. Nowadays Test Studio detects and handles dialogs automatically.
Therefore I would recommend you start a new conversation sharing further information for the issue you are facing. You can consider sharing the following details:
- which is the version of Test Studio you are using
- what type of application you are testing - web or WPF (if web, which browser, along with its version, do you use)
- what is the scenario to cover
- what is not working as you expect it to
- what you have tried so far to fix this
Your comments on all of these topics will be helpful for me to understand what you struggle with and provide you the most proper advice. Thanks for your cooperation in advance.
Regards,
Elena Tsvetkova
Progress Telerik