-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmynapls.php
More file actions
38 lines (28 loc) · 787 Bytes
/
mynapls.php
File metadata and controls
38 lines (28 loc) · 787 Bytes
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
<?php
echo "\n";
require_once 'vendor/autoload.php';
include_once 'config.php';
$user = (isset($user) ? $user : 'my.username');
$pass = (isset($pass) ? $pass : 'my.password');
//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 myNAPLS in browser:
$session->visit('https://my.napls.us');
//get page source
$page = $session->getPage();
//enter the username
$el = $page->find('css', '#logon_user');
$el->setValue($user);
//enter the password
$el2 = $page->find('css', '#logon_pass');
$el2->setValue($pass);
//press the sign in button
$el3 = $page->findButton('Login');
$el3->press();
echo "\n\n";
?>