Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8025151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:04:23+00:00 2026-06-04T23:04:23+00:00

I am using selenium Selenese to do some functional tests. I need to parse

  • 0

I am using selenium Selenese to do some functional tests.
I need to parse the Json content of the body.
Here is the json:

    {"access_token":"ab89978b-   
     74a1-41a6-81e7-7b520ea9d29f","token_type":"bearer","refresh_token":"38a3a34b-09c9-452e-
     b05b-6903770a877f","expires_in":1799,"scope":"read"}

I am using the following Selenese command:

<tr>
<td>store</td>
<td>
    javascript{
        var jsonstr = '${body}'
        var obj=JSON.parse(jsonstr); 
        var token=obj.access_token;
    }
</td>
<td>token</td>
</tr>

But I am getting the following error:

Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: missing ; before statement

Does anyone know how to parse the content of a variable in selenium that contain Json string?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:04:25+00:00Added an answer on June 4, 2026 at 11:04 pm

    You need to use storeEval instead of store

    <tr>
        <td>store</td>
        <td>{&quot;access_token&quot;: &quot;ab89978b-74a1-41a6-81e7-7b520ea9d29f&quot;, &quot;token_type&quot;: &quot;bearer&quot;, &quot;refresh_token&quot;: &quot;38a3a34b-09c9-452e-b05b-6903770a877f&quot;, &quot;expires_in&quot;: 1799, &quot;scope&quot;: &quot;read&quot;}</td>
        <td>json</td>
    </tr>
    <tr>
        <td>echo</td>
        <td>${json}</td>
        <td></td>
    </tr>
    <tr>
        <td>storeEval</td>
        <td>var x = '${json}'; var obj=JSON.parse(x); obj.access_token;</td>
        <td>bam</td>
    </tr>
    <tr>
        <td>echo</td>
        <td>${bam}</td>
        <td></td>
    </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using selenium to run some functional tests on the UI for our current
Just using selenium to fill out some forms for me. I need it to
I am trying to run a series of HTML selenium tests using the selenese
I am using Selenium IDE Firefox plugin to create some test cases. I click
I am using Selenium to give rating to some video. The page source for
I'm using Selenium for work and I have extract some data from //ul, unfortunately
I have been using Selenium Library with Robot Framework for writing automated tests for
I have been using selenium IDE to do some web app testing. I have
I'm using SeleniumRC to run some selense tests via command line. This works mostly
I'm using selenium webdriver to write tests, and the following code returns the error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.