Monday, December 1, 2008

Fix ui-element can't run bug in Chrome TestRunner mode

Selenium-IDE1.0b2 introduced a new feature: UI-Element. It is very useful feature for annoyed XPATH EL.

We try demo in Selenium IDE panel successfully. However, when we try UI-Element test case in Chrome TestRunner, even if we set &userExtensionsURL=chrome://selenium-ide/content/ui-element.js,file:///c:/ui/my-ui-map.js correctly in chrome URL, it failed to load any UI-Element feature.

Weird, we have discussed it on openqa forum. Finally, I fix this bug in chrome://selenium-ide/content/ui-element.js
function is_IDE()
 //[Begin Fix]
 var locstr = window.location.href;  
 if(locstr.indexOf("selenium-ide.xul") != -1){
     //IDE mode   
     return true;
     return false; 
 return (typeof(SeleniumIDE) != 'undefined');
It seems
typeof(SeleniumIDE) != 'undefined'
not work in Chrome TestRunner mode.

Finally, with above fix, UI-Element works in both IDE and Chrome TestRunner.

More discussion:

No comments:

Post a Comment