i wish there was an additional "_wait(maxTime, condition)" function that would stop execution if condition returns false.
as of now, it seems as if "wait + condition" continues execution no matter the outcome of "condition", which makes it an "OR" test, but my suggestion would be for an "AND" test, i.e.:
wait, up until maxTime is reached, and if condition is still false, then stop execution.
i want this because of network/server response timing issues, specifically related to ajax operations.
UPDATE
i just posted this as a discussion in the sahi forums:
suggestion for _wait: stop execution if condition returns false
UPDATE, WORKAROUND
to achieve the same thing today, it looks like you'd have to code it like this:
_wait(10000, _assertTrue(_isVisible(_link("detailsForm:saveAgreementBtn"))));
_assertTrue(_isVisible(_link("detailsForm:saveAgreementBtn")));
and this gives the same functionality, but with less code, but also may look potentially confusing:
_wait(10000, _isVisible(_link("detailsForm:saveAgreementBtn")));
_assertTrue(_isVisible(_link("detailsForm:saveAgreementBtn")));
IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment