Closed leorochael closed 7 years ago
🙈
I'll make a release with return window.jQuery !== undefined;
so that you can try it out.
@leorochael Please, try out 0.7.1 and re-open if the issue remains. Thanks!
Hi @datakurre,
Thanks for the fix, but you only fixed the problem "2" I reported. Problem "1" remains and is the actual root of the problem:
Execute Javascript
always "succeeds" for that statement, even if jQuery is not loaded yet.It'll just return false
, but that's not a problem for Wait Until Keyword Succeeds
, which only repeats a keyword on exception, not on a False
return.
You need to do like I did above and create a Keyword JQuery Should Be Loaded
that uses Should Be Equal
like I documented in the issue, and then wrap it with Wait Until Keyword Succeeds
.
If that isn't done, there is a chance that other keywords from Selenium2Screenshots
fail with a message like "JQuery is not loaded" which is extremely hard to understand since, by the time you get to the JS console on the browser, JQuery will already be loaded, and you'll pull your hair out trying to finish a demo for a conference talk like i did :smirk:.
@leorochael Thanks again, and sorry for needing to explain that again. No that I really got that, I will apply your wrapping approach soonish.
Fixed in https://github.com/datakurre/robotframework-selenium2screenshots/commit/a5b4bb21beda8e71b28be99e8e81ef930118e57d and released in 0.7.2
Thanks!
After adding the jQuery
<script />
tag,Bootstrap jQuery
executes:Which has two bugs:
false
ifwindow.document.jQuery
isundefined
.true
, because jQuery is loaded onwindow.jQuery
not onwindow.document.jQuery
.As a workaround, I created the following Keywords that I use in my robot scripts: