HomeSelenium

New Selenium IDE – Using ‘store json’ command

New Selenium IDE – Using ‘store json’ command

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

store json is one of the commands in Selenium IDE.

The purpose of the store json command is to retrieve and store json content into a variable in Selenium IDE.

In this article, I am going to practically demonstrate store json command in Selenium IDE to retrieve and store the json content into a variable and then print the json content stored in the variable.

store json Selenium IDE - demo

Let’s get started.

New Selenium IDE – store json command

Follow the below steps for practicing store json command in Selenium IDE along with me:

1) Let’s write the below code in Selenium IDE to retrieve and store the json content into a variable and then print the json content stored in the variable using the ‘echo’ command.

[su_table alternate=”no”]

Command Target Value
open http://omayo.blogspot.com/
store json { “glossary”: { “title”: “example glossary”, “GlossDiv”: { “title”: “S”, “GlossList”: { “GlossEntry”: { “ID”: “SGML”, “SortAs”: “SGML”, “GlossTerm”: “Standard Generalized Markup Language”, “Acronym”: “SGML”, “Abbrev”: “ISO 8879:1986”, “GlossDef”: { “para”: “A meta-markup language, used to create markup languages such as DocBook.”, “GlossSeeAlso”: [“GML”, “XML”] }, “GlossSee”: “markup” } } } } } x
echo ${x}

[/su_table]

After incorporating the commands in the above table, our Selenium IDE should look like below:

store json Selenium IDE - typing

2) Run the test and observe that the test will be passed and the json content stored into a variable and then printed in the ‘Log’ tag as shown below:

Note: JSON content will be stored in an object format and will be printed as an object as shown below:

store json Selenium IDE - executed

 

Here concludes the practical demonstration of store json command in Selenium IDE for store json content into a variable.

In the next article, I will practically demonstrate another Selenium IDE command.

Next Steps:

  • > Check complete Selenium Tutorial Contents here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning ?

About Me > Arun Motoori

On a mission to contribute to the Software Testing Community in all possible ways.

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

Comments (4)

  • Is there a way to parse through the stored json value ?

    Reply
  • How to access stored json object variable and access particular value. Like in your json example. I want to access title value and fill into textarea of form. Please help me on this.

    Reply
  • Yes, you can to do it on Selenium IDE. Using

    Command | Target | Value
    execute script | return ${x}.glossary Glossary
    for each | Glossary | i
    execute script | return ${i}.title | title
    echo | ${title}

    If anyone need help with this, I can help you, [email protected]

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp