HOW TO PERFORM DATA DRIVEN USING JSON IN SELENIUM IDE ?

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:

[
  { 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.






Post a Comment

2 Comments

  1. Thank you for your good site. Can I use forJson with URL , for example a url for a servlet that returns .json file?

    ReplyDelete
    Replies
    1. @Mehdi, yes you can. Basically forJson looks for JSON data.

      Delete


What would you like to add in my list? I look forward to reading your comments below.