calling parameters from another xml

瀏覽次數:419 次
跳到第一則未讀訊息

JT_selenium

未讀,
2013年5月28日 下午4:29:322013/5/28
收件者:testng...@googlegroups.com
Hi,
I have parent xml and different child xmls. I want to declare all parameters in parent xml and need to get available in child xml so that i dont need to keep same parameters in all xmls. Is there any way i can do this. I got some solution like below but its not working

<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" [<!ENTITY parent SYSTEM "../parent.xml">]>

where above line is declared in child.xml to call parameters from parent.xml but its not working or not able to link parameters. If there is any other solution to link different xmls please let me know.

thanks,
JT



Krishnan Mahadevan

未讀,
2013年5月28日 晚上10:34:252013/5/28
收件者:testng...@googlegroups.com
I wasnt aware that TestNG suite xmls can extend each other. 

Cedric,
Is this present in TestNG ?
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

Cédric Beust ♔

未讀,
2013年5月29日 凌晨1:07:252013/5/29
收件者:testng...@googlegroups.com
You can include suites in each other with the <suite-files> tag.


-- 
Cédric

JT_selenium

未讀,
2013年5月29日 上午9:59:132013/5/29
收件者:testng...@googlegroups.com、ced...@beust.com
Hi Cedric,
Any solutions where i can describe common parameters in one xml and call that xml in another test suites?

I dont want to use <suite-files> tag as i need to repeat all parameters again in different xmls which i dont want.

Any help will be appreciate.....
thanks,
Jt

On Wednesday, May 29, 2013 1:07:25 AM UTC-4, Cédric Beust ♔ wrote:
You can include suites in each other with the <suite-files> tag.


-- 
Cédric



On Tue, May 28, 2013 at 7:34 PM, Krishnan Mahadevan <krishnan.ma...@gmail.com> wrote:
I wasnt aware that TestNG suite xmls can extend each other. 

Cedric,
Is this present in TestNG ?


On Wednesday, May 29, 2013, JT_selenium wrote:
Hi,
I have parent xml and different child xmls. I want to declare all parameters in parent xml and need to get available in child xml so that i dont need to keep same parameters in all xmls. Is there any way i can do this. I got some solution like below but its not working

<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" [<!ENTITY parent SYSTEM "../parent.xml">]>

where above line is declared in child.xml to call parameters from parent.xml but its not working or not able to link parameters. If there is any other solution to link different xmls please let me know.

thanks,
JT



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

JT_selenium

未讀,
2013年5月29日 上午10:58:142013/5/29
收件者:testng...@googlegroups.com、ced...@beust.com
Got the solution where xml parameters can be defined at one place and can be called in mulitple suite files so need to declare common parameters again. 

Declare like below: 
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" [<!ENTITY parent SYSTEM "../parent.xml">]>

and in parameter field just declare

&parent......it willl take care.

-JT

Krishnan Mahadevan

未讀,
2013年5月29日 晚上11:44:412013/5/29
收件者:testng...@googlegroups.com、ced...@beust.com
That's really interesting! Thanks for sharing this info. I never knew about this till now :)

vamseedhar vuppu

未讀,
2017年4月5日 凌晨12:12:302017/4/5
收件者:testng-users、ced...@beust.com
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" [<!ENTITY parent SYSTEM "../parent.xml">]>
<parameters>&parent;</parameters>

Using above approach is broken with TestNG 10+. Anyone aware of it?

Below is the error we are getting now for "parameters" tag in xml

 org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 15; Element type "parameters" must be declared. 
回覆所有人
回覆作者
轉寄
0 則新訊息