We can do JSON data driven in Selenium IDE using SelBlocks.
Here is the very basic example to perform JSON data driven in Selenium IDE using SelBlocks.
Create a testdata.json file in the C drive with following details:
Here is the very basic example to perform JSON data driven in Selenium IDE using SelBlocks.
Create a testdata.json file in the C drive with following details:
[ { keyword: "hello selenium" } ,{ keyword: "abhishek yadav qa" } ]
- Write the below script in Selenium IDE.
Command | Target | Value |
forJson | file://c:/testdata.json | |
open | / | |
waitForPageToLoad | 5000 | |
typeAndWait | name=q | ${keyword} |
endForJson |
* Base URL:
http://www.google.co.in/
- Save the recorded script.
- Run the recorded script.
3 Comments
Thank you for your good site. Can I use forJson with URL , for example a url for a servlet that returns .json file?
ReplyDelete@Mehdi, yes you can. Basically forJson looks for JSON data.
DeleteThanks!
ReplyDeleteCan you please help me? I need to handle Json files (Request/Response) using Selenium WebDriver + TestNG in Eclipse. I am looking for framework which will be good. I mean..I am thinking of Keyword driven framewwork which will be excel driven, we will write test cases in excel using the keywords (opening json file, reading it, extracting the value from json, doing required operations etc).
Please provide your inputs and how can I achieve this?
What would you like to add in my list? I look forward to reading your comments below.