SeeTestAutomation- Using Mobile Listeners In Perl
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 .
AddMobileListener (type, element, packageName, subroutineName)
Description
This feature allows to handle an unexpected UI interrupts without compromising the test execution speed.
Once a MobileListener is registered, it would be notified about any relevant event and an action may be taken by the client.
Parameters
- type: method of detecting the element
- element: element to detect
- packageName: name of the package where the handler subroutine located
- subroutineName: name of the subroutine to call
Return value:
Whether recovered or not.
- true (return 1)
- false (return 0)
Adding listener:
$client->addMobileListener("NATIVE", "xpath=//*[\@hint='Username']", "TestListener", "recover");
Removing listener (calling without the last 2 parameters and disabling the mobile listener):
$client->addMobileListener("NATIVE", "xpath=//*[\@hint='Username']");
Mobile Listener implementation example:
package TestListener;
require ExperitestClient;
sub recover {
($self, $type, $xpath) = @_;
my $client = $self->{CLIENT};
$client->elementSendText("NATIVE", "hint=Username", 0, "company");
return 1;
}