0

I am facing issues with running my Galen tests on AWS Device Farm, I am properly packaging my .gspec file under src/tests/java folder and providing the same in my POM.xml, but while running the tests on the farm it throws FileNotFound Exception i.e.:

java.io.FileNotFoundException: src/test/java/HomePage.gspec at
 com.galenframework.speclang2.pagespec.PageSpecReader.read(PageSpecReader.java:43)
 at com.galenframework.api.Galen.checkLayout(Galen.java:68) at
 com.galenframework.api.Galen.checkLayout(Galen.java:59) at
 com.galenframework.api.Galen.checkLayout(Galen.java:154) at
 com.galenframework.api.Galen.checkLayout(Galen.java:128) at

This works like a charm on local devices.

KDeogharkar
  • 10,939
  • 7
  • 51
  • 95

2 Answers2

2

I am an engineer from the AWS Device Farm team.

I am not familiar with Galen test framework. We have not officially tested the framework to claim that it works on device farm.

However, few things that I can make out from your description:

1. .gspec file: It seems that the framework is looking to read this file to get started. Any test file based on appium/selenium can be placed under src/test/resources while packaging and this should put the file in *SNAPSHOT-tests.jar file under the root of the jar.

This jar file is then available in the CLASSPATH of the test execution environment which means you would can directly access it. It would save you some time by verifying before uploading to device farm by looking in the *tests.jar file for the presence of the .gspec file.

Alternate way would be to place the file under src/test/resources/com (or any package structure). Then to access the file in your test code you can assume that the file is present under the package structure under resources so in your case file path would be "com/yourfile.gspec".

Hope this helps you to proceed further.

NikofTime
  • 729
  • 3
  • 4
  • Are you getting the same error as you originally posted ? – NikofTime Aug 23 '16 at 06:01
  • Thanks for your reply. As per your suggestions, we had tried in the similar way i.e. keeping the .gspec file under src/test/resources/com and also in the resources directly. Also we are able to see the .gspec file in packaged JAR i.e. SNAPSHOT-tests.jar. Also exracted the contents of this JAR and it did have the gspec file. So all these approaches have not worked. Also, we are assuming that we do have physical devices on the Farm since we as indicated earlier, we are able to successfully run the Galen tests on physical devices locally. – Gaurav Sharma Aug 23 '16 at 06:10
  • Can you share the code snippet or the file path that you are using in your test code to look up the .gspec file ? – NikofTime Aug 23 '16 at 06:11
  • Hi Please find the attached code snippet (File Path) and POM file for maven package – Gaurav Sharma Aug 23 '16 at 06:49
  • As indicated by hypery2k too, you want to use relative path so in the case from the code you shared your path should start from "com/........./yourfile.gspec" rather than "src/test/java/.......". – NikofTime Aug 23 '16 at 15:51
  • Also I really appreciate you providing all the required info. As a side note and general stackoverflow best practice you may want to update your original question with the attachments since you may get down voted for creating a separate answer for follow up to a comment in form of an answer. – NikofTime Aug 23 '16 at 15:55
0

Hi Please find the attached screenshot of code snippet where we are using file path and POM file for maven package.

POMFile

FilePathCode

  • 1
    instead of absolute paths try to use relative paths, e.g. 'HomePage.gspec'. You can try one of my sample projects if it works on AWS device farm: https://github.com/hypery2k/galen_samples/tree/master/junit – hypery2k Aug 23 '16 at 11:30
  • Hi, I have changed the file path and now its throwing UnsatisfiedLinkError exception: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk1.8.0_65/jre/lib/amd64/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821) at Please help on this Regards.. – Gaurav Sharma Aug 24 '16 at 06:12
  • @GauravSharma AWS Device Farm does not support Galen. The list of supported frameworks are documented in the [Developer Guide](http://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html). Can you switch to one of those frameworks? If you'd like to continue troubleshooting the issue, we will need your app and tests to diagnose the root cause. Please open a case via AWS Support, provide a link to your Run along with the app and tests, and we can take it from there. – Rohan Deshpande Aug 26 '16 at 14:46
  • Hi Rohan, Thanks for your reply. I am using Appium Java TestNG. But in my class I am using Galen scripts. Also I am running the test in chrome browser using my application URL. When I run the tests I always face following exception: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk1.8.0_65/jre/lib/amd64/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory. Please help me to resolve this issue – Gaurav Sharma Aug 29 '16 at 07:29