Skip to content

Commit

Permalink
BrwoserStack: Retrieve information about the current session
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Mar 21, 2015
1 parent bfeec73 commit 6f44ac6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions WebDriver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ public function sauce_url() {
}
}

public function browserstack_info() {
if ($this->running_at_browserstack()) {
$url_parts = parse_url($this->server_url);
$response = WebDriver::Curl("GET", "https://" . $url_parts['user'] . ":" . $url_parts['pass'] . "@www.browserstack.com/automate/sessions/" . $this->session_id . ".json");
$result = json_decode(trim($response['body']), true);
return $result['automation_session'];
} else {
return false;
}
}

public function execute($http_type, $relative_url, $payload = null) {
if ($payload !== null) {
$payload = json_encode($payload);
Expand Down

0 comments on commit 6f44ac6

Please sign in to comment.