Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    Flavour is on a distinguished road

      0  

    Exclamation HTA mode fails to load Ext

    HTA mode fails to load Ext


    Ext version tested:
    • Ext 3.3.1


    Adapter used:
    • ext
    • jquery


    css used:
    • only default ext-all.css
    • no CSS


    Browser versions tested against:
    • IE8


    Operating System:
    • Win7


    Description:
    • When running in HTA mode, Ext fails to load when loaded in Head. Unfortunately Selenium uses HTA mode, so this means that IE is untestable with Selenium :/


    Test Case:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script src="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="http://extjs.cachefly.net/ext-3.3.1/ext-all-debug.js" type="text/javascript"></script>
    </head>
    <body>
    </body>
    </html>
    Steps to reproduce the problem:
    • Create HTML above
    • Point a Selenium test at it


    The result that was expected:
    • Page loads without error


    The result that occurs instead:
    • ext-all-debug.js +4907 char 13
    • 'body' is null or not an object


    Debugging already done:
    • Have passed the <meta http-equiv="X-UA-Compatible" content="IE=edge"> & patched Ext to recognise this (as per http://www.sencha.com/forum/showthre...em-on-intranet), so I can see that IE renders as IE8 & Ext also has isIE8 set properly: make sno odds to this issue
    • Have put a setTimeout loop checking doc.body before the doc.body.appendChild(div); (inspired by http://www.sencha.com/forum/showthre...ring-too-early as the error I have is in the same function, although comes earlier)
    • Everything works fine if the Ext scripts are loaded in the body instead of the head (unfortunately this isn't at all easy in my real app!)


    Many thanks for taking a look

    Fran.

  2. #2
    Sencha User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    stashx is on a distinguished road

      0  

    Default


    Hello Fran,

    I had this error with a recent project i had. I don't use Selenium. I didn't even know about it but anyway.

    I can reproduce the error using HTA, extjs and raphael.js . If you save your html code in an .hta file and run it, it works fine. you can even set the <HTA:Application> tag and work just fine. but for an unknow reason when raphael.js is present, Ext js reports to have some errors only if you have the hta tag before the Javascript library loading. for example, copy the following code in a .hta file and double click it to open with mshta:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <HTA:APPLICATION id="MyApp" applicationName="My Application" >
    		
    <script src="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="http://extjs.cachefly.net/ext-3.3.1/ext-all-debug.js" type="text/javascript"></script>
    <script type="text/javascript" src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script>
    
    </head>
    <body>
    </body>
    </html>
    You can fix the above code by ether closing the HTA:application tag (witch most people don't, as the most examples on msdn don't close it. go figure...) like this:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <HTA:APPLICATION id="MyApp" applicationName="My Application" />
    		
    <script src="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="http://extjs.cachefly.net/ext-3.3.1/ext-all-debug.js" type="text/javascript"></script>
    <script type="text/javascript" src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script>
    
    </head>
    <body>
    </body>
    </html>
    or by adding the HTA:application tag at the and of the head tag like i do here (with or without closing it):

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script src="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="http://extjs.cachefly.net/ext-3.3.1/ext-all-debug.js" type="text/javascript"></script>
    <script type="text/javascript" src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script>
    
    <HTA:APPLICATION id="MyApp" applicationName="My Application" />
    </head>
    <body>
    </body>
    </html>

    I have no idea why this error happens but my guess, on your case, is that Selenium adds the HTA:application tag combined with a script on your page. can you right click on the selenium output and view the source? If so, please report the generated source.


    Sorry for using the direct link scripts. i don't do that on my projects.

    Hope that helps you solving this bug (?).
    StashX


    EDIT:
    PS: does anyone have to contribute something in my previous post ? i had replied on a closed thread and i'm not actually sure if anyone inspected it... it is HTA related.

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    Flavour is on a distinguished road

      0  

    Default No HTA tag in my source

    No HTA tag in my source


    Thanks for the reply - unfortunately this doesn't seem related enough:
    I can indeed right-click & 'View Source' - there are no HTA tags being injected into the application's HTML when browsed by *iehta

    More comments/suggestions welcomed

    F

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    stashx is on a distinguished road

      0  

    Default


    there are no HTA tags being injected into the application's HTML when browsed by *iehta
    you mean that you actully did "Point a Selenium test at it", right?

    What happens if you copy the source from the "Selenium output" in a new .hta file and run it?? I'm asking this because i have seen some projects that extend the mshta runtime and that could be the case of Selenium. In this case it could internally change the html code in runtime.

    have you tried to test my "working" (2nd or 3rd code) example with Selenium?

    StashX

    EDIT: Just ignore this post. I had no clue on how this HTA mode of Selenium is implemented...
    Last edited by stashx; 4 Feb 2011 at 7:53 AM. Reason: Had no idea of how Selenium works

  5. #5
    Sencha User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    stashx is on a distinguished road

      0  

    Default


    Ok i managed to test this Selenium hta mode. Could they make it more difficult to understand what you have to do???....

    Anyway i found that the bug is not related with ext in this case but the Selenium it self....

    In order to fix the issues with the ExtJs, you have to edit the "TestRunner.hta" and go to line 169.

    There is the iframe tag where you sould add the Application attribute like this:

    Code:
    <iframe name="selenium_myiframe" id="selenium_myiframe" src="TestRunner-splash.html" application="yes"></iframe>
    Doing so, TestJavaScriptAttributes will fail but i think it shouldn't because it actually alerts the "foo" msg.
    I noticed that this same test passes without the application attribute but there is no alert shown. Isn't this behavior wrong??

    Enough said about the Selenium.. Use my patch and you'll be just fine i guess... If not, i suggest you should seek for more help on the Selenium community.

    let me know if it actually work for you ..

    StashX

  6. #6
    Sencha User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    stashx is on a distinguished road

      0  

    Default


    You can also avoid editing the Selenium and get your case work, if you include ExtJs from local resources. This error seams to happen in your case due to HTA's security policy. You are trying to load external javascript in a non trusted iframe (that's what the previous patch do, lets the iframe page to be trusted)...

    So download ExtJS, extract it in a folder named "extjs" in the same path with your testing html and make your testing html look like this code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script src="extjs/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="extjs/ext-all-debug.js" type="text/javascript"></script>
    </head>
    <body>
    </body>
    </html>
    Cheers,
    StashX

  7. #7
    Sencha User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    Flavour is on a distinguished road

      0  

    Default Local Resources

    Local Resources


    I just tried with the HTA tag &, as you predicted, it doesn't help.
    I actually used local resources to start with - this doesn't help.
    I will now try to compile a new .jar with the modified TestRunner.hta

    Thanks for your interest/help

    F

  8. #8
    Sencha User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    Flavour is on a distinguished road

      0  

    Default Bypass HTA mode

    Bypass HTA mode


    I see that TestRunner.hta does have the HTA tag at the top of HEAD.
    However it is very hard to change this code which is embedded inside the .jar (I am using RC not Core).

    Digging around I have managed to find a workaround:
    Using *piiexplore mode instead of *iehta mode

    Many thanks!
    Fran

Similar Threads

  1. Help, Netbeans Hosted Mode Fails on RPC Calls ??
    By chalu in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 12 Sep 2010, 2:58 PM
  2. Replies: 2
    Last Post: 12 Mar 2010, 1:42 PM
  3. Replies: 4
    Last Post: 7 Dec 2009, 9:52 AM
  4. Hosted mode fails to launch properly
    By Feltros in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 16 Jan 2009, 5:34 PM
  5. Replies: 5
    Last Post: 20 Aug 2007, 8:44 AM

Thread Participants: 1

Tags for this Thread