Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read a values from xml #196

Closed
narendrarajput opened this issue Jun 13, 2018 · 4 comments
Closed

Unable to read a values from xml #196

narendrarajput opened this issue Jun 13, 2018 · 4 comments

Comments

@narendrarajput
Copy link

narendrarajput commented Jun 13, 2018

QAF Version

2.1.13
2.1.14-RC1

I have below testdata in xml file -

<registration>
	<existingdata>
		<title>Mr</title>
		<firstname>Narendra</firstname>
		<lastname>Rajput</lastname>
		<email>narendra.rajput@infostretch.com</email>
		<password>Qwerty@123</password>
		<confirmPassword>Qwerty@123</confirmPassword>
		<message>${registration.existing.user.message}</message>
	</existingdata>
</registration>

And the message's values is store in appdata.en_GB file -

registration.existing.user.message = There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.

While I'm trying to access the message value in BDD step as given below -

Then verify user with same email already registered message '${registration.existingdata.message}'

Code implementation of the above step is -

@QAFTestStep(stepName = "verifyUserAlreadyRegisteredMessage", description = "verify user with same email already registered message {0}")
public void verifyUserAlreadyRegisteredMessage(String message) {
	verifyVisible("message.success.failure.text");
	verifyText("message.success.failure.text", message);
}

Expected behavior

Here I should be able to get the message value i.e. There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.

Actual behavior

But it is retrieving the values as - ${registration.existing.user.message} which is reference key in XML file

@cjayswal
Copy link
Member

you need to load locales. refer managing locales

Please post your questions in users group or stack overflow with tag qaf

@cjayswal
Copy link
Member

Closing issue as question moved to stackoverflow Unable to fetch value from XML file where values passes as a key

@narendrarajput
Copy link
Author

Directory structure :

image

And this is how i have configured in application.properties

env.resources=resources
resources.load.subdirs=1

env.default.locale=en_GB
env.load.locales=en_GB

If anything require please let me know.
Thanks

@cjayswal
Copy link
Member

Able to reproduce with BDD step call.

@cjayswal cjayswal reopened this Jun 25, 2018
@cjayswal cjayswal added this to Backlog in QAF Jun 25, 2018
QAF automation moved this from Backlog to Ready Dec 26, 2018
@cjayswal cjayswal added this to the 2.1.14 milestone Dec 26, 2018
@cjayswal cjayswal moved this from Ready to Released in QAF Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
QAF
  
Released
Development

No branches or pull requests

2 participants