Skip to content

DefaultFrameSupport fails when providing a Page Object in some scenarios #591

@jonnybot0

Description

@jonnybot0

It's possible for calling the FrameSupport methods that take a Page object to lead to a MissingMethodException.

You can reproduce this with this branch of the Geb gradle example that uses the GroovyDoc page: https://github.com/jonnybot0/geb-example-gradle/tree/bug-example

You can run ./gradlew chromeTest --tests GebGroovyDocSpec

I suspect this is because the wrong private withFrame method in DefaultFrameSupport gets called. If I change the call in the page module to either pass mainFrame.firstElement() or don't provide a page object argument at all, the test works as expected (though in the latter case I have to refactor how I invoke my Page).

GebGroovyDocSpec > can navigate packages FAILED
    groovy.lang.MissingMethodException: No signature of method: org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame() is applicable for argument types: (geb.content.TemplateDerivedPageContent) values: [GebGroovyDoc -> mainFrame: geb.navigator.DefaultNavigator]
    Possible solutions: frame(int), frame(java.lang.String), frame(org.openqa.selenium.WebElement), wait(), find(), grep()
        at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:66)
        at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:44)
        at geb.Page.withFrame(Page.groovy:118)
        at GebGroovyDoc.browsePackage(GebGroovyDoc.groovy:17)
        at GebGroovyDocSpec.can navigate packages(GebGroovyDocSpec.groovy:9)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions