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

Re: Drag a file from Windows Explorer to AUT

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

Re: Drag a file from Windows Explorer to AUT

Highlighted
Community Hero

Re: Drag a file from Windows Explorer to AUT

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
Top Kudoed Authors