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.
2 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.
DeleteWhat would you like to add in my list? I look forward to reading your comments below.