Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

How to take snapshot? #1

@bartonhammond

Description

@bartonhammond

Could this example be extended to show how to take a screen shot? I'd like to take screen shot of the screens before each change.

I don't understand the difference between a "snapshot" and a "screenshot".

I tried calling the following Curl POST function and the console log has this:

https://crossbrowsertesting.com/api/v3/selenium/d7831739-4fd7-4423-bdbc-1ce2126ce72d/snapshots
Caught Exception: Undefined property: ToDoTest::$url

The API docs for Take Snap shot mention nothing about this property: https://crossbrowsertesting.com/apidocs/v3/selenium.html#!/default/post_selenium_selenium_test_id_snapshots

  public function takeScreenShot() {
        $sessionId = $this->driver->getSessionId();
        $url = 'https://crossbrowsertesting.com/api/v3/selenium/' . $sessionId . '/snapshots';
        echo "\n" . $url . "\n";
        $ch = curl_init();    
        curl_setopt($ch, CURLOPT_URL,$this->url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, array());                
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
        curl_setopt($ch, CURLOPT_USERPWD, "$this->login:$this->password");
        $result = curl_exec($ch);
        curl_close($ch);
        var_dump($result);
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions