Galen Framework: EcmaError Exception Error in main gspec

302 views Asked by At

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

1

There are 1 answers

1
Gamification On

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