-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathps-test.php
47 lines (35 loc) · 1.02 KB
/
ps-test.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
<?php
echo "\n";
require_once 'vendor/autoload.php';
include_once 'config.php';
$user = (isset($psUser) ? $psUser : 'my.username');
$pass = (isset($psPass) ? $psPass : 'my.password');
$psCreds = $user . ';' . $pass;
//define the driver
//$driver = new \Behat\Mink\Driver\GoutteDriver();
$driver = new \Behat\Mink\Driver\SahiDriver('firefox');
//init session:
$session = new \Behat\Mink\Session($driver);
//start session:
$session->start();
//open PowerSchool in browser:
$session->visit('https://ps7-na.treca.org/admin/');
//get page source
$page = $session->getPage();
//enter the username
//$el = $page->find('css', '#logon_user');
//$el->setValue($user);
//enter the credentials
$el2 = $page->find('css', '#fieldPassword');
$el2->setValue($psCreds);
//press the Sign In button
$el3 = $page->find('css', '#btnEnter');
$el3->press();
//enter the credentials
$el2 = $page->find('css', '#ss.yui-ac-input');
$el2->setValue('hood');
//press the Search button
$el3 = $page->find('css', '#btnSearch.search');
$el3->press();
echo "\n\n";
?>