Forum Discussion

maumrm's avatar
maumrm
Contributor
5 years ago

File Explorer during Web Testing

Is there a best practice for how to navigate/select/open files during automation testing of web applications?

 

I have a test that during the application a file needs to be loaded. When the test selects the button which brings up the file explorer window to navigate/select/and load the file it works while on my machine. But once I run the test on a VM it no longer works even though the file is on an accessible drive and the window opens once clicked in the application. 

 

The error I receive is "The combo box items "All Files (".") not found.". This occurs even though the window is there. I also included a screen shot of the step in TestComplete. The "dlgChooseFileToUpload" step is where this test fails on the VM.

 

Thanks,

Mike

13 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Try putting a Delay right before the step that fails.  The VM may be running a bit slower than your machine and the test is getting ahead of itself.  If that fixes it, we can suggest better ways to handle it than the Delay, but this is a quick way to prove it.

    • maumrm's avatar
      maumrm
      Contributor

      Hi Marsha -

      Thanks for the idea, I tried a couple different delays and neither one worked. The window is up and shown in the fail screenshot, so it is there, just not recognized during VM testing.

       

      Any other thoughts?

       

      Thanks,

      Mike

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        The window is up and shown in the fail screenshot, so it is there, just not recognized during VM testing.

         

         


        "Visible" and "Exists" and "Active" = true don't necessarily all occur at once.  In other words, just because you can see it doesn't necessarily mean TC can see it, which is exactly the predicament  you are in.

         

        What I would try next is turning Debug on and stepping through the code from a little before the failure happens.  See if you can get past the step that way.

         

         

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    OK, I'm not sure I understand the relationship between the error you're documenting and the screenshot.

     

    The error is indicating that there's a Combo box item "All Files "(.)"" That cannot be found... but the screenshot doesn't show anything about clicking on a combo box item.  Can you double check?

    • maumrm's avatar
      maumrm
      Contributor

      Hi Robert -

      I agree, I am puzzled why there is an error about a combo box for this situation. Attached is a part of the cooresponding screen shot of the failure. As you can see the cursor had selected the Upload key, then the explorer is also open. That explorer option is just not seen and the cooresponding failure relates to a combo box.

       

      Thanks,

      Mike