Frame problems in FF and IE

11 posts, 2 answers
  1. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    Hi everyone.

    We are testing a web-application with framed main window, so our tests look lite that:

    Settings mySettings = new Settings(BrowserType.FireFox, @"d:\");
    mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
     
    Manager myManager = new Manager(mySettings);
     
    myManager.Start();
    myManager.LaunchNewBrowser();
     
    myManager.ActiveBrowser.NavigateTo("file:///d:/test.html");
    Element mybtn = myManager.ActiveBrowser.Frames[0].Find.ByName("press_me");
    HtmlControl htmlControl = new HtmlControl(mybtn);
     
    //fine in IE and FF
    htmlControl.Click();
     
    //error in FF only
    htmlControl.MouseClick(MouseClickType.LeftClick);
     
    //error in FF only
    myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, mybtn.GetRectangle());
     
    //error in IE and FF
    myManager.ActiveBrowser.Actions.Click(mybtn);
     
    //error in FF and IE
    myManager.ActiveBrowser.Actions.InvokeEvent(mybtn, ScriptEventType.OnClick);
     
    myManager.Dispose();

    Here you can see finding a button in the first frame and then clicking it in five different ways.

    The html code is like that:

    <html>
    <head></head>
    <frameset cols="25%,*,25%">
      <frame src="frame_a.html" />
      <frame src="frame_b.html" />
      <frame src="frame_c.html" />
    </frameset>
    </html>

    and the frame_a.html is
    <html>
    <body>
    <input type="button" name="press_me" value="press_me" onclick="alert('Hello world!')"/>
    </body></html>


    But after I tested the code, I discovered that FF fails to click on it almost in every case, and IE fails in the last two.
    Though the code and HTML page seem valid, could somebody, please, tell what is wrong?
    Using IE 7, FF 3.6.7 and 3.5.1, WebAii 2.0 the lates build.

    The error produced is like
    Unhandled Exception: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: Execut
    eCommand failed!
    InError set by the client. Client Error:
    System.ArgumentException: Tag collection is either empty or has less elements th
    an the element occurrence requested. RequestedIndex: '0', ElementLength: '0'
       at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage
     id)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(Browse
    rCommand request)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserCla
    ss ieInstance, BrowserCommand request, IHTMLDocument2 document)
    BrowserCommand (Type:'Action',Info:'NotSet',Action:'Click',Target:'ElementId (ta
    gName: 'input',occurrenceIndex: '0')',Data:'',ClientId:'Client_44818831-9568-46b
    5-9a23-3ad5285d5c64',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InErr
    or:'True',Response:'System.ArgumentException: Tag collection is either empty or
    has less elements than the element occurrence requested. RequestedIndex: '0', El
    ementLength: '0'
       at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage
     id)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(Browse
    rCommand request)
       at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserCla
    ss ieInstance, BrowserCommand request, IHTMLDocument2 document)')
    InnerException: none.
     
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand reques
    t)
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boole
    an performDomRefresh, Boolean waitUntilReady)
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
       at ArtOfTest.WebAii.Core.Actions.Click(Element targetElement)
       at testMouseClick.Program.Main(String[] args) in C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\testMouseClick\testMouseClick
    \Program.cs:line 42


    Thanks
    Yaroslav
  2. Missing user
    Missing user avatar

    Posted 22 Jul 2010 Link to this post

    Hi Yaroslav,

    Thanks for the post, I was able to reproduce some of the problems you are encountering and will investigate further.

    In the mean time, please try using the htmlControl.Click(); method as much as possible as most html controls do respond to this and do not require a simulated mouse click.

    Best wishes,
    Nelson Sin
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 23 Jul 2010 Link to this post

    Hi Nelson,

    and thanks for the reply.
    In fact, we try to use HtmlControl.Click() method all the time, but some controls in our application do not respond to it.
    Thus we'll be unable running tests in FF until mouse click emulation works.

    So I'm looking forward hearing some news on this issue.

    Best regards,
    Yaroslav
  4. Answer
    Missing user
    Missing user avatar

    Posted 23 Jul 2010 Link to this post

    Hi again Yaroslav,

    So it looks like the following still works in the sample page you sent:

    HtmlControl htmlControl = Manager.ActiveBrowser.Frames[0].Find.ByName<HtmlControl>("press_me");
    htmlControl.InvokeEvent(ScriptEventType.OnClick);

    Hope that helps.

    Greetings,
    Nelson
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    Hi Nelson,

    and thanks for your help.

    I don't know why, but the last piece of code doesn't work inf Firefox producing the following error:

    InError set by the client. Client Error:
    mozCommandProcessor: FindElement(): Tag collection is either empty or has less elements than the element occurrence requested.TagName: a, Occurrence Requested: 0, All Tags Collection length: 0
    BrowserCommand

    By the way, on this test page I'm unable to use the method Element.GetRectangle() — it produces similar errors.

    Is it possible I have something wrong in my FF settings?

    All the best,
    Yaroslav
  6. Missing user
    Missing user avatar

    Posted 26 Jul 2010 Link to this post

    Hello again Yaroslav,

    I re-checked the code, and it seemed to work for me again. Here is link to configuring Firefox if you have not seen it already and I'm testing in the latest 3.6.8 Firefox version.

    Best wishes,
    Nelson
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2010 Link to this post

    Hi Nelson,

    I really cannot figure out what is happening, but even after reconfiguring Firefox the code didn't work.
    Sad but fact. Thanks for your help.

    All the best,
    Yaroslav
  8. Missing user
    Missing user avatar

    Posted 30 Jul 2010 Link to this post

    Hi again Yaroslav,

    Sorry about that, I'm not sure why it's not working for you. I checked the bug I logged for this, and it's in the works. I gave your account 500 points for reporting this, thanks again.

    All the best,
    Nelson
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 30 Jul 2010 Link to this post

    Hi Nelson,

    sorry for consuming your time for so long.

    I've re-checked the code you gave me and now HtmlControl.InvokeEvent works fine in FF on my test page, but fails in our application.
    Anyway, this means that the problem is in our code, too.

    Thanks a lot for your help, now we know at least where to look for bugs.

    Best regards,
    Yaroslav.
  10. Answer
    Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 10 Aug 2010 Link to this post

    Hello kovyar,

    Do you still get the FF error running the latest 2010.2.806 build of the framework? It seems one of our recent fixes resolves this FF error for other customers so your confirmation that also worked for you could help as well.

    All the best,
    Konstantin Petkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. kovyar
    kovyar avatar
    42 posts
    Member since:
    Jul 2010

    Posted 10 Aug 2010 Link to this post

    Hi Konstantin,

    I've just tested that build and it worked fine with our tests.

    Thanks,
    Yaroslav
Back to Top