Re: Issues with Dojo Canoo and using a CDN

Dierk König <[email protected]>
Newsgroups gmane.comp.web.canoo.webtest
Message-ID <[email protected]>
Hi Lisa,

> We're trying to upgrade to the latest version of Canoo WebTest, which appears to still be 1812, and we already had issues with it that we were working on. But tests that were passing fine using WebTest 1812 are now failing since the upgrade of Dojo.

So it worked before the Dojo upgrade, but not after? (at first, this doesn't really sound like an _WebTest_ error to me ... )

> If there is no way to get around this in Canoo WebTest, I guess our only option is to move to another test framework, which will take us a long time, as we have 8 years' worth (and many thousands of test cases) of WebTest scripts which, up to now, have provided us a lot of value in regression test coverage.

Your long-standing loyalty is much appreciated!

> I've been worried about WebTest since it hasn't been updated much the past year or two. Is it dying out?

WebTest is a functional testing tool for HTML-based web applications.
This is what it addresses and what it does well. 
There is hardly any bugs and the feature set is complete enough.
And since we do not release new versions just for the fun of it, there is not much activity in that area.

But if new issues come up, we are happy to tackle them.

> We switched from:
>     <script type="text/javascript" src="/include/javascript/dojotoolkit/dojo/dojo.js"></script>
> to
>     <script src="https://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>

An architectural remark: this means you went for dynamically assembling your application from self-modifying code that is loaded from unreliable source.

Some people claim that this undermines the value of test-automation since, e.g. the JS that you load from remote can change any time.
What you have tested against may be obsolete one second after the test has finished without you knowing.

> JavaScript error loading page http://localhost:8080/home/index.jsp?&fid=2: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "firstChild" from undefined (https://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo//parser.js#8)

Well, it would be easier to tell with seeing the source code but obviously some JS tries to read "firstChild" from a reference that is undefined.
Why is it undefined? I can only guess. Maybe some dependent remote JS cannot be loaded. Why? There are a thousand possibilities; even invalid certificates.

If that is the case then I would be scared if my browser displays the page without error (but, yes, some do).

I'd advise to download the remote JS, store it on your local server, and load it from there as you did before. (check the google license whether this is allowed)
And, yes, dependency management means more maintenance work.

cheers
Dierk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.