user2459816
user2459816

Reputation: 85

Unable to access properties file information in Amazon aws device farm

I've an automation script where in I wanted to executed the same on AWS device farm

Framework implemented in Maven and all the respective plugins are mentioned in pom.xml as suggested by AWS
I'm able to run the scripts on my local standalone machine
Tech used Appium + Java + TestNG + Android
Successfully uploaded ZIP and apk into AWS

Converted into Zip as shown,

enter image description here

and my Appium-0.0.1-SNAPSHOT-tests contains following files

enter image description here

My framework uses these properties files to pass values to the scripts, so when I trigger the execution it is failing to invoke the properties files

AWS device farm says, "Tests skipped due to test package parsing error"

Please suggest

Upvotes: 0

Views: 469

Answers (2)

Chethan
Chethan

Reputation: 1

ClassLoader loader = Thread.currentThread().getContextClassLoader();
                Properties configs = new Properties();

                BufferedReader metadataReader = new BufferedReader(
                        new InputStreamReader(loader.getResourceAsStream(config.property)));
                sUserConfigs.load(new StringReader(IOUtils.toString(metadataReader).replace("\\", "/")));

you can invoke the property file by using above code.

Upvotes: 0

jmp
jmp

Reputation: 2375

I can't add a comment yet but I wanted to ask for the message returned in the parse result file.

It also may be failing because of some of the configurations set in the testng.xml

Testng XML not accepted by AWS Device Farm

It doesn't appear that all tags in the testng.xml are supported yet in Device Farm.

An example of a valid project using testng can be found at the awslabs github page:

https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app

Upvotes: 0

Related Questions