2

I tried to implement galen responsive testing using example on github but i encounter this error. I using galen 2.4.0 in Java.

public class ResponsiveTestManager extends GalenTestBase {

 private PropertiesManager pm;

 @BeforeSuite 
 public void setup() {
 pm = PropertiesManager.createInstance();
 }


 @Test(dataProvider = "devices")
 public void homepage_responsive(TestDevice device) throws IOException {
 load(pm.getProperties().getProperty("homepage"));
 checkLayout(System.getProperty("user.dir") + "\\galen_specs\\main.gspec", device.getTags());
 }
}

com.galenframework.parser.SyntaxException: JavaScript error inside statement

Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "run_in_grid" is not defined.

main.gspec

@@ Set run_in_grid      selenium grid http://127.0.0.1:4444/wd/hub

Homepage in Selenium Grid
    ${run_in_grid} --page http://phptravels.net/login
        check homepage.gspec

homepage.gspec

@objects
    login-username      css         input[name=username]    

Why got this javascript error. How to solve this issue? Please help. A billion thanks for your help.

I follow this tutorial

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66
nicholas
  • 2,581
  • 14
  • 66
  • 104

1 Answers1

0

Is there a reason why @@ Set has an uppercase S here? Anyways, it doesn't seem to be neccessary to use the run_in_grid variable at all, so this main.gspec should work according to how variables work:

Homepage in Selenium Grid
    selenium grid http://127.0.0.1:4444/wd/hub --page http://phptravels.net/login
        check homepage.gspec
Gamification
  • 787
  • 5
  • 20
  • FAILED: homepage_responsive(mobile 450x800) com.galenframework.parser.SyntaxException: Unknown statement: Homepage in Selenium Grid – nicholas Jan 22 '19 at 02:42