{"action":"created","comment":{"url":"https://api.github.com/repos/minkphp/docs/pulls/comments/23488066","id":23488066,"diff_hunk":"@@ -1,76 +1,116 @@\n Controlling the Browser\n =======================\n \n-Ok. Now we know how to create the browser driver to talk with a specific\n-browser emulator. Although we can use drivers directly to call some actions\n-on the emulator, Mink provides a better way - ``Session``:\n+In Mink, the entry point to the browser is called the session. Think about\n+it as being your browser window (some drivers even allow to deal with switching\n+tabs).\n+\n+The first thing to do with your session is to start it. Nothing can be done\n+with it before starting it.\n \n .. code-block:: php\n \n-    // init session:\n+    // Choose a Mink driver. More about it in later chapters.\n+    $driver = new \\Behat\\Mink\\Driver\\GoutteDriver();\n+\n     $session = new \\Behat\\Mink\\Session($driver);\n \n-    // start session:\n+    // start the session\n     $session->start();\n \n .. note::\n \n-  As you can see, the first argument to the session (``$driver``) is just\n-  a simple driver instance, which we created in the previous chapter.\n+    The first argument to the session constructor is a driver object. Drivers\n+    are the way the Mink abstraction layer works. You will discover more\n+    about the available drivers in a :doc:`later chapter </guides/drivers>`.\n+\n+.. caution::\n \n-``start()`` call is required in order to configure the browser emulator or\n-controller to be fully functional.\n+    Although Mink does its best on removing browser differences between different\n+    browser emulators, it can't do much in some cases. See the :ref:`driver-feature-support`\n+    to see which features are supported by each driver.\n \n Basic Browser Interaction\n-~~~~~~~~~~~~~~~~~~~~~~~~~\n+-------------------------\n \n-After you've instantiated the ``$session`` object, you can control the actual\n-browser emulator with it:\n+The first thing to do when using your session is to open a page with it.\n+Just after starting, the session is not on any page (in a real browser, you\n+would on the ``about:blank`` page), and calling any other action is likely\n+to fail.\n \n .. code-block:: php\n \n-    // open some page in browser:\n     $session->visit('http://my_project.dev/some_page.php');\n \n-    // get the current page URL:\n-    echo $session->getCurrentUrl();\n+.. note::\n \n-    // get the response status code:\n-    echo $session->getStatusCode();\n+    Mink is primarily designed to be used for testing websites. To allow\n+    covering error pages as well, the ``Session::visit`` method does not\n+    consider error status codes as invalid. It will not throw an exception\n+    in this case. You will need to check whether the response was a success\n+    or an error. It will only throw an exception when Mink cannot load the\n+    page (network error, ...). For cases, when driver does not support status\n+    code retrieval, it might be possible to assert text on the page itself\n+    to determine whether it is an error page or no.","path":"guides/session.rst","position":69,"original_position":71,"commit_id":"b529188e2cbb73f7cc3cb298c9a050788fcf2f5c","original_commit_id":"78519aa19268f4ad6e9e91b5be0a29b2a04e5be9","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"body":"Thanks for this suggestion @weaverryan. Your experience as documenter is much appreciated.","created_at":"2015-01-23T23:22:28Z","updated_at":"2015-01-23T23:22:28Z","html_url":"https://github.com/minkphp/docs/pull/45#discussion_r23488066","pull_request_url":"https://api.github.com/repos/minkphp/docs/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/minkphp/docs/pulls/comments/23488066"},"html":{"href":"https://github.com/minkphp/docs/pull/45#discussion_r23488066"},"pull_request":{"href":"https://api.github.com/repos/minkphp/docs/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/minkphp/docs/pulls/45","id":27559927,"html_url":"https://github.com/minkphp/docs/pull/45","diff_url":"https://github.com/minkphp/docs/pull/45.diff","patch_url":"https://github.com/minkphp/docs/pull/45.patch","issue_url":"https://api.github.com/repos/minkphp/docs/issues/45","number":45,"state":"open","locked":false,"title":"Rewrite the session chapter","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"body":"This is my work to fix https://github.com/minkphp/docs/issues/33\r\n\r\nI'm not yet done on it (everything after the ``.. todo::`` directive is still the old content). I will update the PR later with the end of the chapter.","created_at":"2015-01-17T18:06:39Z","updated_at":"2015-01-23T23:22:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88d7226e02a571dbc3586eb6d4eb9adc5cc477f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/minkphp/docs/pulls/45/commits","review_comments_url":"https://api.github.com/repos/minkphp/docs/pulls/45/comments","review_comment_url":"https://api.github.com/repos/minkphp/docs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/minkphp/docs/issues/45/comments","statuses_url":"https://api.github.com/repos/minkphp/docs/statuses/b529188e2cbb73f7cc3cb298c9a050788fcf2f5c","head":{"label":"stof:session","ref":"session","sha":"b529188e2cbb73f7cc3cb298c9a050788fcf2f5c","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"repo":{"id":28839329,"name":"mink-docs","full_name":"stof/mink-docs","owner":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stof/mink-docs","description":"Mink documentation","fork":true,"url":"https://api.github.com/repos/stof/mink-docs","forks_url":"https://api.github.com/repos/stof/mink-docs/forks","keys_url":"https://api.github.com/repos/stof/mink-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stof/mink-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stof/mink-docs/teams","hooks_url":"https://api.github.com/repos/stof/mink-docs/hooks","issue_events_url":"https://api.github.com/repos/stof/mink-docs/issues/events{/number}","events_url":"https://api.github.com/repos/stof/mink-docs/events","assignees_url":"https://api.github.com/repos/stof/mink-docs/assignees{/user}","branches_url":"https://api.github.com/repos/stof/mink-docs/branches{/branch}","tags_url":"https://api.github.com/repos/stof/mink-docs/tags","blobs_url":"https://api.github.com/repos/stof/mink-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stof/mink-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stof/mink-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/stof/mink-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stof/mink-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/stof/mink-docs/languages","stargazers_url":"https://api.github.com/repos/stof/mink-docs/stargazers","contributors_url":"https://api.github.com/repos/stof/mink-docs/contributors","subscribers_url":"https://api.github.com/repos/stof/mink-docs/subscribers","subscription_url":"https://api.github.com/repos/stof/mink-docs/subscription","commits_url":"https://api.github.com/repos/stof/mink-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/stof/mink-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/stof/mink-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/stof/mink-docs/issues/comments/{number}","contents_url":"https://api.github.com/repos/stof/mink-docs/contents/{+path}","compare_url":"https://api.github.com/repos/stof/mink-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stof/mink-docs/merges","archive_url":"https://api.github.com/repos/stof/mink-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stof/mink-docs/downloads","issues_url":"https://api.github.com/repos/stof/mink-docs/issues{/number}","pulls_url":"https://api.github.com/repos/stof/mink-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/stof/mink-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/stof/mink-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stof/mink-docs/labels{/name}","releases_url":"https://api.github.com/repos/stof/mink-docs/releases{/id}","created_at":"2015-01-06T00:42:28Z","updated_at":"2015-01-06T00:42:38Z","pushed_at":"2015-01-23T02:16:39Z","git_url":"git://github.com/stof/mink-docs.git","ssh_url":"git@github.com:stof/mink-docs.git","clone_url":"https://github.com/stof/mink-docs.git","svn_url":"https://github.com/stof/mink-docs","homepage":"http://mink.behat.org","size":268,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"minkphp:master","ref":"master","sha":"afed839c6a7805c2835cbd8ad4299240105eeee4","user":{"login":"minkphp","id":10380339,"avatar_url":"https://avatars.githubusercontent.com/u/10380339?v=3","gravatar_id":"","url":"https://api.github.com/users/minkphp","html_url":"https://github.com/minkphp","followers_url":"https://api.github.com/users/minkphp/followers","following_url":"https://api.github.com/users/minkphp/following{/other_user}","gists_url":"https://api.github.com/users/minkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/minkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minkphp/subscriptions","organizations_url":"https://api.github.com/users/minkphp/orgs","repos_url":"https://api.github.com/users/minkphp/repos","events_url":"https://api.github.com/users/minkphp/events{/privacy}","received_events_url":"https://api.github.com/users/minkphp/received_events","type":"Organization","site_admin":false},"repo":{"id":2093133,"name":"docs","full_name":"minkphp/docs","owner":{"login":"minkphp","id":10380339,"avatar_url":"https://avatars.githubusercontent.com/u/10380339?v=3","gravatar_id":"","url":"https://api.github.com/users/minkphp","html_url":"https://github.com/minkphp","followers_url":"https://api.github.com/users/minkphp/followers","following_url":"https://api.github.com/users/minkphp/following{/other_user}","gists_url":"https://api.github.com/users/minkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/minkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minkphp/subscriptions","organizations_url":"https://api.github.com/users/minkphp/orgs","repos_url":"https://api.github.com/users/minkphp/repos","events_url":"https://api.github.com/users/minkphp/events{/privacy}","received_events_url":"https://api.github.com/users/minkphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minkphp/docs","description":"Mink documentation","fork":false,"url":"https://api.github.com/repos/minkphp/docs","forks_url":"https://api.github.com/repos/minkphp/docs/forks","keys_url":"https://api.github.com/repos/minkphp/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minkphp/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minkphp/docs/teams","hooks_url":"https://api.github.com/repos/minkphp/docs/hooks","issue_events_url":"https://api.github.com/repos/minkphp/docs/issues/events{/number}","events_url":"https://api.github.com/repos/minkphp/docs/events","assignees_url":"https://api.github.com/repos/minkphp/docs/assignees{/user}","branches_url":"https://api.github.com/repos/minkphp/docs/branches{/branch}","tags_url":"https://api.github.com/repos/minkphp/docs/tags","blobs_url":"https://api.github.com/repos/minkphp/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minkphp/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minkphp/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/minkphp/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minkphp/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/minkphp/docs/languages","stargazers_url":"https://api.github.com/repos/minkphp/docs/stargazers","contributors_url":"https://api.github.com/repos/minkphp/docs/contributors","subscribers_url":"https://api.github.com/repos/minkphp/docs/subscribers","subscription_url":"https://api.github.com/repos/minkphp/docs/subscription","commits_url":"https://api.github.com/repos/minkphp/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/minkphp/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/minkphp/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/minkphp/docs/issues/comments/{number}","contents_url":"https://api.github.com/repos/minkphp/docs/contents/{+path}","compare_url":"https://api.github.com/repos/minkphp/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minkphp/docs/merges","archive_url":"https://api.github.com/repos/minkphp/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minkphp/docs/downloads","issues_url":"https://api.github.com/repos/minkphp/docs/issues{/number}","pulls_url":"https://api.github.com/repos/minkphp/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/minkphp/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/minkphp/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minkphp/docs/labels{/name}","releases_url":"https://api.github.com/repos/minkphp/docs/releases{/id}","created_at":"2011-07-23T13:25:15Z","updated_at":"2015-01-22T22:02:12Z","pushed_at":"2015-01-22T22:02:12Z","git_url":"git://github.com/minkphp/docs.git","ssh_url":"git@github.com:minkphp/docs.git","clone_url":"https://github.com/minkphp/docs.git","svn_url":"https://github.com/minkphp/docs","homepage":"http://mink.behat.org","size":425,"stargazers_count":58,"watchers_count":58,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":12,"forks":20,"open_issues":12,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minkphp/docs/pulls/45"},"html":{"href":"https://github.com/minkphp/docs/pull/45"},"issue":{"href":"https://api.github.com/repos/minkphp/docs/issues/45"},"comments":{"href":"https://api.github.com/repos/minkphp/docs/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/minkphp/docs/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/minkphp/docs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/minkphp/docs/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/minkphp/docs/statuses/b529188e2cbb73f7cc3cb298c9a050788fcf2f5c"}}}}