开发者

Can we retrieve XML data into DataProviders in TestNG? if so how?

I have an XML file with data of popup information. I need to retrieve them one by one and use it in my test method in Java. I开发者_运维问答 am using selenium RC.

XML file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<windows listsize="4"> 
<popups>
    <win>
             <title>exact:What List?</title>
         <val>28</val>        
    </win>  
</popups>
</windows> 

Note: it would be great if the response is in java.

Please help.


This is more a question about XML than it is about TestNG, but just look up "Java XML" and you'll find tons of parsers and libraries to help you do that. Once you have parsed that information, return it from your data provider.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜