HOW TO PERFORM DATA DRIVEN USING XML IN SELENIUM IDE ?

We can do XML data driven in Selenium IDE using SelBlocks.
Here is the very basic example to perform XML data driven in Selenium IDE using SelBlocks.




Create a testdata.xml file in the C drive with following details:


    <vars keyword="hello selenium" />
    <vars keyword="abhishek yadav qa" />





  • Write the below script in Selenium IDE.
Command
Target
Value
forXml
file://c:/testdata.xml
open
/

waitForPageToLoad
5000

typeAndWait
name=q
${keyword}
endForXml


* Base URL:
http://www.google.co.in/




  • Save the recorded script.
  • Run the recorded script.






Post a Comment

5 Comments

  1. What if any of the test data fails, how to skip it and move on next set of data in selenium

    ReplyDelete
    Replies
    1. Which type of failure? Can you provide more clarification?

      Delete
    2. Hi!
      I use this method for registrations on the web. My xml contains ~ 100 users & 100 events.
      If a registration is failed (e.g: the user is not right for the event)all of the remaining vars will not executing.
      How can I solve this problem?
      Thank you

      Delete
  2. I am receiving this error:

    [error] Unexpected Exception: Error: Error while fetching URL 'file://c:/data.xml':: [Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://selblocksseleexten/content/extensions/data-reader.js?1486673134223 :: FileReader.prototype.getDocumentSynchronous :: line 269" data: no].

    Any idea why?

    ReplyDelete
  3. I am getting this error "A element could not be loaded, or was empty.. " Please help me..

    ReplyDelete


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