Examples for flexDragDrop

48 views
Skip to first unread message

James

unread,
Jul 7, 2011, 2:09:18 PM7/7/11
to flex-pilot
Hi, I'm having trouble creating a selenium script that will drag a
element to a given coordinate OR an element to another element.

Using the testApp here (http://saucelabs.com/example_files/flexpilot/
index.html):

In Firebug I am able to execute the following line perfectly fine:

document.getElementById("testApp").fp_dragDropToCoords({"name":"dragSprite","coords":"5,100"});

However in Selenium IDE as well as scripts that I write in Java, I am
unable to do the same thing:

selenium.flexDragDropToCoords("id=testApp",
"name=dragSprite,coords=(5,100)");
selenium.flexDragDropToCoords("id=testApp",
"name=dragSprite,coords=5,100");

What is the correct format?

Adam Christian

unread,
Jul 7, 2011, 2:14:40 PM7/7/11
to flex-...@googlegroups.com
Are you able to click and execute other functionality with java?

Adam

James

unread,
Jul 7, 2011, 2:34:23 PM7/7/11
to flex-pilot
Adam, yes.

- waitForFlexReady works correctly as well at click/type.
- Selenium RC is using the user extensions

In the IDE I am using the following in the three fields (command,
target, value)

flexDragDropToCoords
id=testApp
name=dragSprite,coords=(5,100)

I get the output:

# [info] Executing: |flexDragDropToCoords | id=testApp |
name=dragSprite,coords=(5,100) |
# [error] Coordinates must be in format "(x, y)"

I tried to format the parameters differently but no luck.

James

Adam Christian

unread,
Jul 7, 2011, 2:44:11 PM7/7/11
to flex-...@googlegroups.com, Jeremy Olsen
Hi Jeremy,

I was wondering if you had any of the examples of this available? I'd rather not take the time to go root around in the codebase if I don't have to. And I know we fixed some issues here.

Since the format looks right and the firebug stuff works right I'm wondering if there is an escaping issue somewhere in this.

Adam

James

unread,
Jul 8, 2011, 2:52:56 PM7/8/11
to flex-pilot
I'm using the pre-built FlexPilot-4.swf if that has any relevance.

James

unread,
Jul 11, 2011, 2:09:31 PM7/11/11
to flex-pilot
In the function parseCoords inside FPController.as, the parameter
coordsStr is receiving the incorrect value

private static function parseCoords(coordsStr:String):Point {
var coords:Array = coordsStr.replace(
/\(|\)| /g, '').split(',');
...
}

Calling the following:

selenium.flexDragDropToCoords("id=testApp",
"name=dragSprite,coords=(5,100)");

would result in the value "(5" being passed into the function, causing
it to always throw an error.

I changed the delimiter to something other than a comma and
dragAndDrop works correctly now.

James
Reply all
Reply to author
Forward
0 new messages