Forum Discussion

vijay6105's avatar
vijay6105
Contributor
12 years ago

Working with Windows Explorer

Hello,



As a part of my automation I need to copy some files from windows explorer one location and paste it in another location. Can any one provide me the code to open windows explorer source location, copy,open windows explorer destination location and paste.



I can able to launch explorer through testedapps but I need structured approach to open a specific location, copy and paste  


4 Replies

  • I'm not sure why you need to go through Windows Explorer, you could just use the AQFile method in a Test Complete script.

    Here is a code example in jscript that would do just this:



    aqFile.Copy("C:\\OldFile\\Oldfile.txt", "C:\\NewFile\\NewFile.txt");



    Hope this helps.



    Louis-Philippe

  • Seetal's avatar
    Seetal
    Occasional Contributor
    Hi there,



    With the Silverlight application that I am testing, there is a 'browse' button on the UI that is clicked which then opens Windows Explorer.



    I then need to navigate to the required directory location to select the file that I want to upload to the Silverlight spplication.



    Are there any built in functions that will help me carry out these steps?
  • vajindarladdad's avatar
    vajindarladdad
    Frequent Contributor
    Hi Seetal,

    I don't think there is a need to browse till the end of file location.



    Once you press the 'browse' button a "File Select" dialog will appear , enter the complete name in "File Name" comboBox and Click OK button.



    Example : You can enter the file name as "C:\TC\BIN\AAA.txt" and click OK or Press Enter.



    I hope this has been of some help.