If you’ve been working with touch screen devices such as smart phones or tablets (iPhone, iPod Touch, iPad, or Android), you may be wondering how to scroll (flick) to get to content that’s off the screen.
Very simply, anything that needs to happen with touches (excluding multi-touch gestures) will be accomplished with eggPlant’s mouse commands. So taps/touches are accomplished with the click command, scrolling or something that would require dragging a finger acros the screen would be accomplished using the drag, drop, and/or dragAndDrop commands.
In it’s simplest form, you can use a dragAndDrop to scroll the screen:
dragAndDrop "StartImage", "StopImage"
When capturing images for the start and stop images, it’s best to capture something that doesn’t change, like the carrier name on the iPhone or something in the notification bar on Android and move the hotspot to the start and end positions, so your images might look something like this:
Starting Locatation: http://www.testplant.com/img/forum/PhoneHotspot1.png
Ending Location: http://www.testplant.com/img/forum/PhoneHotspot2.png
You may need to experiment with eggPlant’s Run Options in order to make sure that your drag and drop is not interpreted as a click and hold, particularly on Android devices. You can tweak these options as part of your script.
There are 4 global properties that eggPlant applies when working with mouse movement in this situation.
[list]the remoteWorkInterval. This is the minimum amount of time eggPlant will wait between actions on a system. Measured in seconds
the mouseDragSpeed. This is how fast the mouse moves on drag and is measured in pixels/segment.
the mouseMoveDelay. This is how much eggPlant waits between segments of the drag
dragEndDelay. This one represents a slight delay before the mouse up message.[/list:u]
You can set all but the dragEndDelay in the Run Options of Preferences. But you won’t want to do that, as all 4 of them can be set programmatically during the script. Once you set them, they’re set until the run ends or the settings are changed again.
You will need to experiment with these settings to get the timing right. So what you’ll want to do is first save off the old value for each one:
put the remoteWorkInterval into oldRWI
Then set it to the new one:
put.3 into the remoteWorkInterval
You can set up functions that imitate the behavior by using the above settings and using the drag, drop, and dragAndDrop commands… folding all of the setting and resetting the global prefs and the mouse movements into one package.
If you do find yourself having trouble with your settings, feel free to email support and we’d be happy to help!
Sr. Systems Engineer