Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Draging a file from one folder and droping it onto the exe in another folder
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi ,
i want to know how can i select ,then Drag a CSV file from one folder over the exe placed in another folder


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Taran,
In order to achieve drag and drop, we shall use "Mercury.DeviceReplay" Object.Please see the example below for your reference
Code:
with Browser("..").Page("...r")    

x1=.WebElement("innerhtml:=TextBox").GetROProperty("abs_x")+10
h=.WebElement("innerhtml:=Text Box").GetROProperty("height")
y1=.WebElement("innerhtml:=Text Box").GetROProperty("abs_y")+h-10

end with

Set oDeviceReplay=CreateObject( "Mercury.DeviceReplay" )
oDeviceReplay.DragAndDrop x1,y1,x2,y2, LEFT_MOUSE_BUTTON
where
(x1,y1)=drag point
(x1,y2)=drop point
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi ...
i am actually interested in Dragging a File from one folder (C:\Newfolder) to say (D:\NewFolder)...

i am working on a Desktop application which requires an excel file to be dragged and dropped on an EXE of the app...

please help with this
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
My suggestion is Open the C:\Newfolder excel sheet and save it in the location of D:\Newfolder then delete the file in c:\Newfolder.

Code:
set ExcelObj = CreateObject("Excel.Application")
set oBook = ExcelObj.Workbooks.Open("C:\Newfolder.xls")
ExcelObj.Application.Visible = True
Excelobj.ActiveWorkbook.saveas "D:\newfolder.xls"
Excelobj.quit

next delete the c folder workbook
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Executing via create "RES"xx folder? nishitd 0 1,244 03-07-2018, 01:09 AM
Last Post: nishitd
  code for validation to create a sub folder smiley 0 1,540 10-19-2016, 10:08 PM
Last Post: smiley
  Extract and save a file from zip folder using VB Script karthicksri07 1 6,425 06-29-2016, 02:19 PM
Last Post: Ankesh
  [UFT] Close opened folder robertosalemi 1 3,334 02-10-2016, 07:06 PM
Last Post: robertosalemi
  Exe invoked through UFT is unable to access IIS and SQL Server service bkdevise 0 2,146 08-25-2015, 05:49 PM
Last Post: bkdevise

Forum Jump:


Users browsing this thread: 1 Guest(s)