Skip to main content

SeeTestAutomation- SwipeWhileNotFound

info

Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .


Description

Swipe the screen to search for an element.

Parameters

  • Direction: Direction to swipe
  • Offset: Swipe offset
  • Zone: Select Zone
  • Element to find: Select Element to find
  • Delay: Time to wait before sending a command (in milliseconds)
  • Rounds: Maximum swipe rounds
  • Click: Boolean
    • True: click on the element once it is found
    • False: Will only make the element visible

Usage

Scenario: We will use the imdb movie data application.

To swipe the screen of the "Movies"  to select "Best Picture Winners" option and then to click on it.

Parameters:

  • Direction: Down
  • Offset: 100
  • Swipe Time: 2000
  • Zone: NATIVE
  • Element to find: xpath=//*[@text='Best Picture Winners']
  • Element to find index: 0
  • Delay: 1000
  • Rounds: 5
  • Click: true

Once found it will be clicked

Code Examples

Java Example

if(client.swipeWhileNotFound("Down", 0, 2000, "NATIVE", "xpath=//*[@text='Best Picture Winners']", 0, 1000, 5, true))
{
// If statement
}

C# Example Expand source

if(client.SwipeWhileNotFound("Down", 0, 2000, "NATIVE", "xpath=//*[@text='Best Picture Winners']", 0, 1000, 5, true))
{
// If statement
}

VBScript Example Expand source

If StrComp (client.SwipeWhileNotFound ( "Down", 0, 2000, "NATIVE", "xpath=//*[@text='Best Picture Winners']", 0, 1000, 5, true ), "True") = 0 Then
Report
'If statement
Else
Report
End If

Python Example Expand source

if(self.client.swipeWhileNotFound2("Down", 0, 2000, "NATIVE", "xpath=//*[@text='Best Picture Winners']", 0, 1000, 5, True)):
# If statement
pass

Perl Example Expand source

if($client->swipeWhileNotFound2("Down", 0, 2000, "NATIVE", "xpath=//*[\@text='Best Picture Winners']", 0, 1000, 5, 1)){
# If statement
}