Forum Discussion

morde's avatar
morde
Contributor
11 years ago

Working With Open File and Save File Dialogs

Hi,

I'm trying to run an automated test including an uploading of ppt slide decks to a web application.



I have a step of clicking on the upload button and then the open file dialog opens.

this step is getting a list of 3 input parameters of the desired file paths ,

it should run 3 times and set each file path at the time, and upload the file.





The problem is that  inconsistently the first isn't uploading and the followed are uploading  properly. 

I checked the path and the path is correct.. (I also tried to change the order and switched between the first and second path so that as a first path will be the path worked in the past and the second will be the path which was the first one before and didn't work) 

 so it is not related to the path. 

 

Also I tried to make "refresh mapping info"  and a wait of 30 sec before setting the first path into the to the file name field, and it also didn't help. 



* in the log I see that all the path's delivery is correct, however sometimes for the first slide deck, the open file dialog object is not recognized and then the following 2 files are uploading properly.

 

Do you have any idea why this is happening and how to solve the problem ?

 

Thanks in advance 

Silvana

6 Replies

  • Hi Tanya, 



    I still can't figure it out. I wrote a test which uses this dialog several times. This test can work perfectly sometimes when I am running it as a "stand alone" test. The strange thing is - when this test is running as a part of tests set - this "bug" returns:

    In the first trial, the dialog is not recognized (so the first file is not uploaded).



    notice that there is only one dialog open, in both cases.



    What can be the reason for that? 



    Thank you,

    Mor
  • Hi Paul,



    The dialog was identified by its #32770 and its caption (which was customize to fit both FF and IE with the conditional mode).



    I figured out a part of the problem: the first time this dialog pops up (on FF only!) - TC doesn't recognize it because it's located under "Process("Firefox")" and not under "Browser("Firefox")" as it really is...



    I created a script to handle this but its a walkaround and I prefer a good solution :)



    Thanks,

    Mor
  • Thanks for the help.



    I eventually closed it using the onUnexpectedWindow event handler.