$show=home$hide=mobile-page

Drag and drop item from windows explorer to application using UFT

Subroutine to drag and drop item from windows explorer to application using UFT or QTP. By default this feature is not yet available in QTP or UFT.

Subroutine to drag and drop item from windows explorer to application using UFT or QTP. By default this feature is not yet available in QTP or UFT
A Subroutine to drag and drop item from windows explorer to application using UFT/QTP.

QTP\UFT do not have a default functionality to drag an item from windows explorer window to application under test.

Let us consider a scenario where we want to drag an image from windows explorer to TinEye, which is one of the best image search and recognition company.

Manual steps that we would follow are
  1. Access TinEye website (https://www.tineye.com)
  2. Identify the area where a drag and drop facility is available.
  3. Open image location using windows explorer.
  4. Select the image in the folder and drag it to the website. 
If you try to record these steps with UFT, you will discover that UFT will not capture the drag and drop operation. This is because of the security features setup in Windows. For this to work in UFT you have to run UFT as administrator and run windows explorer as administrator programmatically. Windows security settings will not allow this to happen. In this post, we introduce a subroutine as a workaround for this problem.

Here is what the subroutine does.

Parameters to pass
  1. FilePath – path of the file to drag and drop (e.g. “C:\Users\Public\Pictures\Sample Pictures\Koala.jpg”)
  2. DropAreaObject – pass the object on which file has to be dropped
Subroutine Action
  1. Check whether the file exist
  2. Create browser window object
  3. Create explorer windows object
  4. Open folder path
  5. Resize and move the folder window
  6. Select the item passed
  7. Detect position of the file in the explorer window
  8. Resize and move browser window
  9. Move the drop area to view
  10. Detect position of drop area
  11. Drag item from windows explorer to drop area and release mouse to drop item 
The Subroutine



Working Sample


COMMENTS





Name

AngularJS,3,Automation Testing,8,CSharp,5,Disqus,1,Excel,2,HP ALM,5,HTML5,1,ISTQB,2,Java Script,2,Manual Testing,7,Photography,1,Quiz,2,REST API,5,Testing,15,UFT,8,VB,5,VBScript,1,Wordpress,1,
ltr
item
Aneejian: Drag and drop item from windows explorer to application using UFT
Drag and drop item from windows explorer to application using UFT
Subroutine to drag and drop item from windows explorer to application using UFT or QTP. By default this feature is not yet available in QTP or UFT.
https://4.bp.blogspot.com/-ArcLp_9Tpps/WMf3GxhyEfI/AAAAAAAAAE8/AfRzUbeW3KwDlb6GN4_yqft7bdrOHeIRQCLcB/s320/featured%255B1%255D.jpg
https://4.bp.blogspot.com/-ArcLp_9Tpps/WMf3GxhyEfI/AAAAAAAAAE8/AfRzUbeW3KwDlb6GN4_yqft7bdrOHeIRQCLcB/s72-c/featured%255B1%255D.jpg
Aneejian
http://www.aneejian.com/2016/08/drag-and-drop-item-from-windows-explorer-to-application-using-uft.html
http://www.aneejian.com/
http://www.aneejian.com/
http://www.aneejian.com/2016/08/drag-and-drop-item-from-windows-explorer-to-application-using-uft.html
true
5798203121010168414
UTF-8
Loaded All Posts No posts found VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU ARCHIVE SEARCH ALL POSTS No post found which matches with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy