I have script that loops through an array of html tag id’s, some elements in the array are empty. I have an if statement that works fine in Firefox but throws a null pointer or not an object error in IE
if((storedVars.id) != ("")){selenium.browserbot.getCurrentWindow().document.getElementById(storedVars.id).type;}
why does it fail in IE and not in firefox and what is the proper syntax for IE?
In IE it might be undefined or
nullrather than empty string, so try this instead:(also bit more efficient due to
!==operator comparing two strings)