How to parse xml file in my junit selenium test case using eclipse, I want to grab data from this file and insert it in forms using my selenium RC test case.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at dom4j, and this is my approach. I implemented a selenium + Junit framework and all the data inputs are in XML format. So I setup the structure of the xml input. So If you are going on this direction I would advise you to identify what xml format/structure.
Example:
One you finalize on the structure you can start writing a parse and expose the data into rest of the test or just for a one test.
Here is the start for your xml parser, Create a class and have the constructor read in the xml file,
It doesn’t have to be a hashmap but thats what I wanted to do you can make this method to return anything that you wish based on your framework.
Have Fun;