In a test scenario of my web application, a click button opens the common detailed MS Windows native window which allows to choose a file by drag & drop, or to enter it with or without its path, then validate the choice by a click button and close the window, so that the scenario continues.
Katalon Studio does not record the actions on the MS Windows dialog box and the manipulated objects and the modification of the script with the keyword proposed in the online documentation “WebUI.uploadFile(findTestObject(‘my button object’), ‘my path file name’)” does not work.
How to save the objects of the dialog box?
What keywords should be used in the script to get around this problem and switch between web environment and Windows environment?
- Click on web button
- The MS Windows dialog box is open
- Tape the file name to load
- Click the open windows button
- The MS Windows dialog box is closed
Thanks in advance for your advice
I don’t believe it is possible to use the spy recording tools across Web and Windows environments – you will have to code the test by hand.
When you start a new test case, the relevant APIs for both WebUI and Windows should already be imported.
thank you for answering Russ
Unfortunely it is already the case.
My difficulty is how to identify properties of this Windows dialog, to create by hand a new window object in KS’s objects repository (what value for this dialog class, name, id etc.) to use keywords windows after.
@vu.tran Who is the Windows testing guru?
Thank you @Russ_Thomas for sharing this with me. I will check internally and get back to @thierry.gonzalvez soon. Thank you guys!
Thank you all,
To clarify, I provide the following screenshots and the test procedure
- I navigate until this modal popup very easily
- I click the « ajouter des fichiers » web button
- A native MS Windows opens. I must enter a file name and its path in a control edit, click the “Open” button BUT I don’t know how to do it
- I follows testcase steps by clicking on “Tout télécharger” button etc.
You don’t need to touch the “ajouter des fichiers” dialog at all. If I understand correctly, what you’re trying to do is upload file(s).
Find the element in the HTML that deals with the file…
<input type="file" ...>
Great Russ it works now! Really thank you for the help.
I declare the web object with the input type file found into html xpath (ex: input_file1 with xpath = //*[@id=“form:j_idt132_input”]), so without click on my object and using uploadFile only, it works:
// Open the web popup for uploading
// select the files to upload
// etc. if many files to load
// Send all the selected files
Thank you @thierry.gonzalvez for your confirmation, would you help summarize the solution and mark it for other users’ future reference? See how to mark solution in this post Show your appreciation through LIKES and SOLUTION MARKS - Everything you need to know!.
Thank you @Russ_Thomas for all your help!