-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAndroidApp.php
48 lines (38 loc) · 1.54 KB
/
AndroidApp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require 'vendor/autoload.php';
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\Remote;
use Facebook\WebDriver\WebDriverExpectedCondition;
$caps = array(
"app"=> "lt://proverbial-android", //Enter app_url here
"deviceName" => "Galaxy S20",
"platformName" => "Android",
"platformVersion" => "10",
"isRealMobile" => TRUE,
"visual" => TRUE,
"video" => TRUE,
"name" => "Php - Android test",
"build" => "Php Vanilla - Android"
);
$username = getenv("LT_USERNAME") ? getenv("LT_USERNAME") : "USERNAME"; //Enter username here
$accesskey = getenv("LT_ACCESS_KEY") ? getenv("LT_ACCESS_KEY") : "ACCESS_KEY"; //Enter accesskey here
@$driver = RemoteWebDriver::create("https://$username:$accesskey@mobile-hub.lambdatest.com/wd/hub",$caps);
try{
$color_element = $driver->findElement(WebDriverBy::id('color'));
$color_element->click();
$text_element = $driver->findElement(WebDriverBy::id('Text'));
$text_element->click();
$toast_element = $driver->findElement(WebDriverBy::id('toast'));
$toast_element->click();
$notification_element = $driver->findElement(WebDriverBy::id('notification'));
$notification_element->click();
$geoLocation_element = $driver->findElement(WebDriverBy::id('geoLocation'));
$geoLocation_element->click();
sleep(5);
$driver->quit();
} finally {
$driver->quit();
}
?>