cancel
Showing results for 
Search instead for 
Did you mean: 

Drag a file from Windows Explorer to AUT

SOLVED
Highlighted
Community Hero

Drag a file from Windows Explorer to AUT

Hi,

 

Scenario:

Select a file from Windows Explorer, Click and Drag into AUT Grid. Upload dialog should be displayed.

 

I want to drag a file from Windows Explorer into my AUT grid.

 

Question:

How do i select a particular file from Windows Explorer.

 

P.S: I have done code for opening Windows Explorer with specified path using cmd.

 

Any help would be greatly appreciated!


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Bingoo @karthick7, I too followed the same post for this and found the solution.

 

Solution:

 

Adding DirectUIHWND class in MSAA, Text Recognition and UI Automation in Project properties.

 

then,

 

function testasdf()
{
       fn_ClickaFilein_WE("test_file_01.txt")
}
function fn_ClickaFilein_WE(str_FileOrFolerName)
{
      var WindowsExplorer = Aliases.WindowsExplorer.ContentPane;
      var arr_Items = null;
      
      fn_OpenWindowsExplorer(Project.Path + "Test_Files_Folders");//Custom function
      
      arr_Items = WindowsExplorer.FindAllChildren("ObjectType","ListItem")
      
      for(var i = 0 ; i < arr_Items.length ; i++)
      {
            if(aqString.Compare(aqConvert.VarToStr(arr_Items[i].value),str_FileOrFolerName,false) == 0)
            {
                  arr_Items[i].Click();
                  break; 
            }
      }   
}

 

Then I used Drag method.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

View solution in original post

2 REPLIES 2
Highlighted
Contributor
Highlighted
Community Hero

Bingoo @karthick7, I too followed the same post for this and found the solution.

 

Solution:

 

Adding DirectUIHWND class in MSAA, Text Recognition and UI Automation in Project properties.

 

then,

 

function testasdf()
{
       fn_ClickaFilein_WE("test_file_01.txt")
}
function fn_ClickaFilein_WE(str_FileOrFolerName)
{
      var WindowsExplorer = Aliases.WindowsExplorer.ContentPane;
      var arr_Items = null;
      
      fn_OpenWindowsExplorer(Project.Path + "Test_Files_Folders");//Custom function
      
      arr_Items = WindowsExplorer.FindAllChildren("ObjectType","ListItem")
      
      for(var i = 0 ; i < arr_Items.length ; i++)
      {
            if(aqString.Compare(aqConvert.VarToStr(arr_Items[i].value),str_FileOrFolerName,false) == 0)
            {
                  arr_Items[i].Click();
                  break; 
            }
      }   
}

 

Then I used Drag method.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors