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