For Page Factory page can we pass the value for @FindBy from a xml file

129 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Abhijit Biradar

ungelesen,
26.06.2016, 11:04:4526.06.16
an Selenium Users
Hi friends,

I have a query regarding Page Factory design pattern.

Can we pass the value for @FindBy from a xml file...? Means for our project we maintain a xml file which contain  all parameter( config, test data, object identification value , etc...)
So, what i want to know can we read that identification type & it's value from xml file & pass to @FindBy annotation...?

currently we pass values hard coded like below.

for example:
@FindBy(name="uid")
WebElement userName;

Thanks in adv.

Regards,
Abhijit

⇜Krishnan Mahadevan⇝

ungelesen,
27.06.2016, 13:32:2127.06.16
an Selenium Users
Abhijit,

This was an interesting problem for me. So I decided to spend a little bit of time on this and created a blog post that should help you build this on your own.


As an example I have used JSON files, but you should be able to alter this and make use of Xml files as well.


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/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
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/ba9f3004-e533-49b0-bebe-8157c26a483d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Abhijit Biradar

ungelesen,
29.06.2016, 11:23:2329.06.16
an Selenium Users
Thanks you very much Krishnan. I was struggling from many days to find a good way on this problem but couldn't find. but your solution has fulfill my project automation need  regarding Page Factory.

Regards,
Abhijit
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten