[Webtest] Trying to get Webtest to run on pages with document.execCommand()

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Thu, 07 Feb 2008 09:51:42 +0100


Hi,

the support for execCommand needs to be added in HtmlUnit. Can you
please open an issue there?

In the mean time, if what is done in design mode (ie the execCommand)
doesn't matter, you can turn js error detection to false when your test
loads pages using execCommand.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


George Policello wrote:
> I am trying to get Webtest to run on pages that contain the unofficial
> JavaScript command /document.execCommand()/. That command is supported
> by Firefox and IE and appears within JavaScript Tags on quite a few web
> pages. There is no way around having to go to pages that contain this
> construct (/document.execCommand()/), so only going to pages that do not
> contain the construct is not an option.
> 
>  
> 
> I also checked for commentary on the Rhino sites but found nothing. I
> would be happy to have a setting for Webtest or Rhino that takes care of
> this.
> 
>  
> 
> I picked a public web site to try what I knew contained reasonably
> complicate content. The Webtest tests fail with the following messages.
> The */green italics/* is the target page that includes the
> */fndHome.js/* with the /document.execCommand() /in it. Of course, color
> coding this does not help unless one is using HTML for email.
> 
>  
> 
> JavaScript error loading page
> */http://products.vzw.com/index.aspx?id=search_games&appSearchParentCategoryId=247
> <http://products.vzw.com/index.aspx?id=search_games&appSearchParentCategoryId=247>
> /*: TypeError: Cannot find function execCommand.
> (http://cache.getitnow.edgesuite.net/scripts/fndHome.js#45)
> 
>  
> 
> In the Details part of the results page I got this message and the full
> text of the JavaScript from */fndHome.js/*.
> 
>  
> 
> javascript errorTypeError: Cannot find function execCommand.
> (http://cache.getitnow.edgesuite.net/scripts/fndHome.js#45)
> 
> line 45
> 
>  
> 
> So Webtest loaded the page and the included */fndHome.js/* page fine but
> dies on the missing /document.execCommand()/ capability.
> 
>  
> 
> Given the */green link/* above, and a reasonable JavaScript debugger (in
> Firefox, say the WebDeveloper package), it is easy to see the full text
> of */fndHome.js/*. I did not include it here but anyone that wants me to
> send a copy can ask and I will send it.
> 
>  
> 
> Has anyone run into this and found a work around? If so, your help would
> be greatly appreciated.
> 
> George
> 
>  
>