Skip to content

Instantly share code, notes, and snippets.

@tarappo

tarappo/test-script.php Secret

Created Mar 14, 2013
Embed
What would you like to do?
ログインするだけのスクリプト。
<?php
require_once "__init__.php";
$wd_host = 'http://localhost:4444/wd/hub';
$web_driver = new WebDriver($wd_host);
//ブラウザ指定
$session = $web_driver->session('chrome');
$session->open('http://www.facebook.com/');
//emailとpass入力
$session->element('id', 'email')->clear();
$session->element('id', 'email')->value(array('value' => str_split("your email")));
$session->element('id', 'pass')->clear();
$session->element('id', 'pass')->value(array('value' => str_split("your password")));
//ログイン
$session->element('id', 'u_0_3')->click();
sleep(10);
$session->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment