View Full Version : Extjs Automated Testing with WebTest or HtmlUnit
neodymium
1 Jun 2008, 5:58 PM
We are currently experimenting with the use of automation testing tools such as WebTest and HtmlUnit but unfortunately they are falling over when the ExtJs library is used.
Has anyone had any attempt to use any automation test tools to test pages that include ExtJs? What tools work best?
I appreciate any responses.
mystix
1 Jun 2008, 6:16 PM
found this from the google custom search (it's in my signature):
http://extjs.com/forum/showthread.php?p=168988
Anyone using HtmlUnit (http://htmlunit.sourceforge.net) for automated Tests?
The current version seems to have problems evaluating the JS for this simple Test:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = 's.gif';
Ext.onReady(function(){ new Ext.Button({ text: 'myButton', renderTo: 'myDiv' }); });
</script>
</head>
<body>
<div id="myDiv"></div>
</body>
</html>
ExtJS 3.2.1: TypeError: Cannot call method "on" of null (.../ext-all-debug.js#10303)
item.on(e, o[e], o.scope, o); // <= Oops ... 'item' is NULL
ExtJS 2.3.0: TypeError: Cannot call method "on" of null (.../ext-all-debug.js#20642)
var btnEl = this.btnEl = btn.child(this.buttonSelector);
btnEl.on('focus', this.onFocus, this); // <= Oops ... 'btnEl' is NULL
btnEl.on('blur', this.onBlur, this); // <= Oops ... 'btnEl' is NULL
It doesn't seem to matter which browser I'm emulating - I tried FIREFOX_[2|3] and INTERNET_EXPLORER_[6|7|8]. When I patch ExtJS to check for NULL before invoking the 'on'-function I'm getting a lot further. Did anyone bump into this?
The JavaScript engine used by HtmlUnit chokes on the :first-child selector (used in >= 2.2.1).
Workaround:
Ext.override(Ext.Button, { buttonSelector: 'button:first' }); (reverts to the selector used in <= 2.2)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.