Example script contents:
This example waits for a welcome page to appear, then logins into the application.
// Waiting for WelcomePage to appear
hat.click(".WelcomePage .anybutton.login");
// Waiting for field_login (not needed, "type" on next line will wait also, just an example of using wait)
hat.wait(".SimpleEnterPage .field_login input");
// Slowly (letter by letter) filling in field with login
//wt.jquery("input.login",(el) => { el.val("test"); });
hat.val(".SimpleEnterPage .field_login input","");
hat.type(".SimpleEnterPage .field_login input","test");
// Just adding some texts
hat.jquery(".SimpleEnterPage .field_password input",(el) => { el.val("12345"); });
hat.jquery(".SimpleEnterPage .field_server input",(el) => { el.val("demo2"); });
// Clicking on agree
hat.click(".SimpleEnterPage .field_policy_agree .checkbox");
// Can be also done via click()
hat.jquery(".SimpleEnterPage .submit .value input",(el) => { el.click(); });
// Just executing some code
hat.func(() => { hat.vars.sku_number=0; });
// Waiting for successfull initialization
hat.wait(".sync-in-progress");
hat.wait(".sync-done");
Launching:
To execute this in cordova app or in web page, you can do something like that (please keep in mind that this is not a best practice, but easiest for first-timers).
$("head").append('<link href="https://hybridapptester.com/scripter.css" rel="stylesheet" type="text/css">');
$("head").append('<script src="https://hybridapptester.com/scripter/?api_key=keyname&script_id=1&autostart=1"></script>');