Can eValid do drag and drop actions

Applying eValid to AJAX applications that require advanced DOM-based methods.

Can eValid do drag and drop actions

Postby SFeddin » Thu Mar 12, 2020 9:14 am

Morning.

Can eValid simulate a "drag and drop" kind of user action?

Thanks
SFeddin
 
Posts: 1
Joined: Thu Mar 12, 2020 9:12 am

Re: Can eValid do drag and drop actions

Postby eValid » Fri Mar 13, 2020 2:39 pm

SFeddin wrote:Morning.

Can eValid simulate a "drag and drop" kind of user action?

Thanks


Thanks for posting SFeddin.

This takes direct access to the DOM, using the IndexElementEvent commands.

Here is a sample command sequence:

# This prototype script uses DOM manipulations to achieve a drag/drop.
# Locate the element to be dragged...

IndexSet 0
IndexFindElement 1 DOWN "id" "BlankFundFloating Chart" ""
IndexFindElement 1 DOWN "innerText" "Returns: MRQ. YTD, 1, 3, 5, 7 10 Yrs" ""
Wait 1000

# Put the mouse down...
IndexElementEvent 1 "onmousedown" "button" "1" ""
Wait 1000

# Move the mouse from the starting location to a new location...
# The selected object should drag along...

IndexElementEvent 1 "onmousemove" "ClientX" "104" "ClientY "212" ""
Wait 1000
IndexElementEvent 1 "onmousemove" "ClientX" "204" "ClientY "212" ""
Wait 1000
IndexElementEvent 1 "onmousemove" "ClientX" "304" "ClientY "212" ""
Wait 1000
IndexElementEvent 1 "onmousemove" "ClientX" "404" "ClientY "212" ""
Wait 1000
IndexElementEvent 1 "onmousemove" "ClientX" "474" "ClientY "271" ""
Wait 1000

# Release the mouse....
IndexElementEvent 1 "onmouseup" "button" "1" ""
Wait 1000


The "Wait 1000" commands are probably unnecessary, but they assure that the DOM has time to "settle" before going to the next command.

Probably a "Wait 100" or even a "Wait 10" would do this as well.


-- eValid Support
eValid
 
Posts: 2042
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to AJAX Applications & DOM Processing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons