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

check Component Spec on self Object #654

Open
andreasschiestl opened this issue Oct 26, 2020 · 1 comment
Open

check Component Spec on self Object #654

andreasschiestl opened this issue Oct 26, 2020 · 1 comment

Comments

@andreasschiestl
Copy link

Hi!

When you try to apply a component spec on the self element a exception will be thrown:

    self:
        component someSpec.gspec

Exception:

Caused by: java.lang.IllegalArgumentException: objectContextLocator cannot be null
        at com.galenframework.page.selenium.SeleniumPage.findObjectContext(SeleniumPage.java:82)
        at com.galenframework.page.selenium.SeleniumPage.<init>(SeleniumPage.java:66)
        at com.galenframework.page.selenium.SeleniumPage.createObjectContextPage(SeleniumPage.java:158)
        at com.galenframework.validation.specs.SpecValidationComponent.checkInsideNormalWebElement(SpecValidationComponent.java:159)
        at com.galenframework.validation.specs.SpecValidationComponent.check(SpecValidationComponent.java:56)
        at com.galenframework.validation.specs.SpecValidationComponent.check(SpecValidationComponent.java:40)
        at com.galenframework.validation.PageValidation.check(PageValidation.java:70)
        at com.galenframework.validation.PageValidation.check(PageValidation.java:60)
        at com.galenframework.validation.SectionValidation.checkObject(SectionValidation.java:187)
        at com.galenframework.validation.SectionValidation.checkObjects(SectionValidation.java:97)
        at com.galenframework.validation.SectionValidation.checkSection(SectionValidation.java:131)
        at com.galenframework.validation.SectionValidation.checkPageSection(SectionValidation.java:76)
        at com.galenframework.validation.SectionValidation.check(SectionValidation.java:53)
        at com.galenframework.validation.specs.SpecValidationComponent.checkInsidePage(SpecValidationComponent.java:141)
        at com.galenframework.validation.specs.SpecValidationComponent.checkInsideNormalWebElement(SpecValidationComponent.java:161)
        at com.galenframework.validation.specs.SpecValidationComponent.check(SpecValidationComponent.java:56)
        at com.galenframework.validation.specs.SpecValidationComponent.check(SpecValidationComponent.java:40)
        at com.galenframework.validation.PageValidation.check(PageValidation.java:70)
        at com.galenframework.validation.PageValidation.check(PageValidation.java:60)
        at com.galenframework.validation.SectionValidation.checkObject(SectionValidation.java:187)
        at com.galenframework.validation.SectionValidation.checkObjects(SectionValidation.java:97)
        at com.galenframework.validation.SectionValidation.checkSection(SectionValidation.java:131)
        at com.galenframework.validation.SectionValidation.checkPageSection(SectionValidation.java:76)
        at com.galenframework.validation.SectionValidation.check(SectionValidation.java:53)
        at com.galenframework.api.Galen.checkLayoutForPage(Galen.java:114)
        at com.galenframework.api.Galen.checkLayout(Galen.java:86)
        at com.galenframework.api.Galen.checkLayout(Galen.java:69)
        at com.galenframework.javascript.GalenJsApi.checkLayout(GalenJsApi.java:104)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
        ... 37 more
@andreasschiestl
Copy link
Author

andreasschiestl commented Oct 27, 2020

A possible workaround is to use @import for this special use case. Note that @import can also be used in combination with @if.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant