crossbrowsertesting / selenium-php-behat

A quick guide to using Behat with CBT
4 stars 7 forks source link

JSON decoding of remote response failed. Error code: 4 The response: 'Missing sessionId' #4

Open bartonhammond opened 6 years ago

bartonhammond commented 6 years ago
~/projects/selenium-php-behat (master)$ bin/behat -c config/single.conf.yml
Feature: Login to page
    A login attempt with valid credentials
    Should be accepted
    And a login attempt with bad credentials
    Should be rejected

  Scenario: Login with bad credentials                                        # /Users/bartonhammond/projects/selenium-php-behat/features/login.feature:7
    Given I go to "https://crossbrowsertesting.github.io/login-form.html"     # FeatureContext::iGoTo()
      JSON decoding of remote response failed.
      Error code: 4
      The response: 'Missing sessionId'
    When I fill in "#username" with "bhammond@wisnet.com"                     # FeatureContext::iFillInWith()
    And I fill in "#password" with "xxxxxx"                               # FeatureContext::iFillInWith()
    And I press ".form-actions > button"                                      # FeatureContext::iPress()
    Then I should see ".alert-danger" say "Username or password is incorrect" # FeatureContext::iShouldSeeSay()

  Scenario: Login with good credentials                                       # /Users/bartonhammond/projects/selenium-php-behat/features/login.feature:14
    Given I go to "https://crossbrowsertesting.github.io/login-form.html"     # FeatureContext::iGoTo()
      JSON decoding of remote response failed.
      Error code: 4
      The response: 'Missing sessionId'
    When I fill in "#username" with "bhammond@wisnet.com"                     # FeatureContext::iFillInWith()
    And I fill in "#password" with "yyyyyyyy"                        # FeatureContext::iFillInWith()
    And I press ".form-actions > button"                                      # FeatureContext::iPress()
    Then I should see "#logged-in-message>p" say "You are now logged in!"     # FeatureContext::iShouldSeeSay()
  [WebDriverException]                                                                     
  Exception has been thrown in "afterFeature" hook, defined in FeatureContext::tearDown()  

  JSON decoding of remote response failed.                                                 
  Error code: 4                                                                            
  The response: 'Missing sessionId'                                                        

behat [--init] [-f|--format="..."] [--out="..."] [--lang="..."] [--[no-]ansi] [--[no-]time] [--[no-]paths] [--[no-]snippets] [--[no-]snippets-paths] [--[no-]multiline] [--[no-]expand] [--story-syntax] [-d|--definitions="..."] [--name="..."] [--tags="..."] [--cache="..."] [--strict] [--dry-run] [--stop-on-failure] [--rerun="..."] [--append-snippets] [--append-to="..."] [features]
bartonhammond commented 6 years ago

When I enter https://bhammond@wisnet.com:u045960@crossbrowsertesting.com/wd/hub (with good credentials) I get message Missing sessionId and in dev tools the hub is getting 500

screen shot 2018-03-12 at 3 52 42 pm
bartonhammond commented 6 years ago

Also note, this needs to be updated to newer Behat et al

chasecook411 commented 6 years ago

@bartonhammond Thanks for letting us know you're having trouble. We'll have these docs updated ASAP. As for the Missing Sessionid you see in your browser, this is typical of hitting the hub without the /session/ path. I see you've already opened a conversation with us through our in-app chat system. We'll get you on the right track there.

bartonhammond commented 6 years ago

Thanks Chase!

On Mon, Mar 12, 2018 at 5:31 PM, chasecook411 notifications@github.com wrote:

@bartonhammond https://github.com/bartonhammond Thanks for letting us know you're having trouble. We'll have these docs updated ASAP. As for the Missing Sessionid you see in your browser, this is typical of hitting the hub without the /session/ path. I see you've already opened a conversation with us through our in-app chat system. We'll get you on the right track there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/crossbrowsertesting/selenium-php-behat/issues/4#issuecomment-372484436, or mute the thread https://github.com/notifications/unsubscribe-auth/ABORPCT6tj0nFhr-8o3lk1_h7ApH3r9pks5tdvckgaJpZM4SlQAp .

dzschille commented 6 years ago

@bartonhammond see https://github.com/dzschille/behat3-cbt for an example with Behat 3.