automated tests - Geb / Groovy - Page content not recognized when used within other Page Object method -
When I click on a button, I have to render for some dynamic content. When I waited, it works correctly to stop the examination. However, I want to wait for a method inside the Thapton object, so I do not always need to call for waiting, after every click, but when I do this fails stating that this property Can not get it.
This is not working:
The class landing page extension page {static content = {resultsBtn (result: page) ($ ("button", id: " The results page expanded {page {static content = {results {$ ("div", id: "listresults"), }}}} ShowResults class GebReportingTest {@Test Public Zero DisplayPrint ()) receives landing page (relationships) ()}} Some such situation says, "No such asset: Results for the class results page "
Is it possible to reference the content within the other page objects from other page objects?
EDIT: I think there is more of a Groovy specific thing than Gabe. I'm not sure it is possible to use binding within content closing. But it seems like creating a getVariable () function inside the page object, or does not help much before you should not assign a closure to content blocks (unnecessary =
ResultPage ) but pass them in an indirect way, you should: < code> static content = {result {$ ("div", id: "listresults")}} The second question is why do you call it as two pages Want Dal? As far as I think clicking on a button does not reload any page, but there is an AJAX call to retrieve the results. I will just enter both results and resultsBtn as the contents of a page and your problem will end. Edit: It has been found that your case involves a page change, assuming that you always want to display these results If you want to wait, you either:
-
static = {} results page inside static > Block - Which means that wherever you go to that page, - a
waitFor to -
landing page : Anyone in waitFor {browser.page.results.displayed} Use the current page through the browser's property on the page, but it seems like a dirty solution to me - one page in the other ...
Comments
Post a Comment