-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAndroidWeb.php
46 lines (36 loc) · 1.41 KB
/
AndroidWeb.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
<?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(
"deviceName" => "Galaxy .*",
"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:[email protected]/wd/hub",$caps);
try{
$driver->get("https://mfml.in/api/getInfo");
$color_element = $driver->findElement(WebDriverBy::id('resolution'));
$color_element->click();
$text_element = $driver->findElement(WebDriverBy::id('location'));
$text_element->click();
$toast_element = $driver->findElement(WebDriverBy::id('details'));
$toast_element->click();
$notification_element = $driver->findElement(WebDriverBy::id('timezone'));
$notification_element->click();
sleep(5);
$driver->quit();
} finally {
$driver->quit();
}
?>