Automating website having XML Content through selenium webdriver

174 views
Skip to first unread message

gurpreet kaur

unread,
Aug 7, 2014, 7:51:26 AM8/7/14
to seleniu...@googlegroups.com
Hi All,

How to automate webpage having XML content using selenium webdriver. Please provide help.

Thanks and Regards,
Gurpreet

Harish Krishnan

unread,
Aug 7, 2014, 7:53:37 AM8/7/14
to seleniu...@googlegroups.com
Just use the java to red the values and wat ever you want to do in your application, Work on it


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c88debfb-326b-4a11-aa27-fe8ad52e5473%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gurpreet kaur

unread,
Aug 7, 2014, 8:10:17 AM8/7/14
to seleniu...@googlegroups.com
Hi Hari,

The content on the XML page is dynamic. It keeps on changing every 15 minutes. What can be done in this case. 

Andrew Deschain

unread,
Aug 7, 2014, 9:06:35 AM8/7/14
to seleniu...@googlegroups.com
I assume that the content of the XML may change but not the structure itself.
You should be able, in any way, to get either the innerHtml or the text attribute of the element which holds the xml data.

This data can be further processed / validated natively within the language you are using.

If this does not help, you may provide an example or further information so we can help you.

Thomas Sundberg

unread,
Aug 7, 2014, 9:46:32 AM8/7/14
to Selenium Users
On 7 August 2014 14:10, gurpreet kaur <gurpreetk...@gmail.com> wrote:
> Hi Hari,
>
> The content on the XML page is dynamic. It keeps on changing every 15
> minutes. What can be done in this case.
>

You can verify that the expected structure is available. The actual
data may differ, but the structure it lives in is probably not
changing in a random way.
You could perhaps use the application and therefore affect the content
available in the XML snippet in a way that you can foresee.

/Thomas
> https://groups.google.com/d/msgid/selenium-users/264cff1d-7280-4901-9707-b8dd05d16dde%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

gurpreet kaur

unread,
Aug 8, 2014, 2:47:42 AM8/8/14
to seleniu...@googlegroups.com
Hi Andrew,

I need to ensure that Data is appearing in XML. For eg:


For this XML, need to ensure that the XML is not empty. Since data will be continuously changing, I cannot put assertion on the data. So, how should I proceed in this case.

Thanks and Regards,
Gurpreet

Er. Debasish Dutta

unread,
Aug 8, 2014, 4:23:31 AM8/8/14
to seleniu...@googlegroups.com
Hi,

You can store test data in excel format and use it for data driven testing.






For more options, visit https://groups.google.com/d/optout.



--

Thanks & Regards,

Debasish Dutta

DongXiang

unread,
Aug 8, 2014, 4:41:42 AM8/8/14
to seleniu...@googlegroups.com
you can find the top element which hold this xml. in your example, it's id="collapsible0", then get the text content from this element via web driver, it should be the xml content.
I checked with javascript, it looks the contents are below:
<pmarticleshow
<ActionParams msid="39837028" prtpage="0"/>
</pmarticleshow>

looks the first line lost ">", it may cause the xml parse error. Not sure what's the reason. 

Hope it can help you.

--david


Date: Thu, 7 Aug 2014 23:47:42 -0700
From: gurpreetk...@gmail.com
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] Automating website having XML Content through selenium webdriver

Andrew Deschain

unread,
Aug 8, 2014, 10:53:12 AM8/8/14
to seleniu...@googlegroups.com
It seems you try to validate data coming form some kind of webservice.
In this case you dont actually need Selenium / WebDriver at all.

Just make an http request from within your script and you should be good to go.
Let the XML be parsed by some 3rd party library and check the keys of the XML and not the Values itself (or maybe verify they are not empty).

gurpreet kaur

unread,
Aug 11, 2014, 1:42:57 AM8/11/14
to seleniu...@googlegroups.com
Hi Andrew, Can you please suggest some third Party library that could check the keys of XML?

Thanks and Regards,
Gurpreet

Andrew Deschain

unread,
Aug 11, 2014, 3:20:12 AM8/11/14
to seleniu...@googlegroups.com
Hi Gurpreet,

I dont know in which language you are developing. I suppose its Java (with which i dont have any experience).
Maybe there is already an appropriate parser build in. If not, im pretty sure there is a good one available in your package manager (or have a look at github).
Reply all
Reply to author
Forward
0 new messages