This is a migrated thread and some comments may be shown as answers.

Frame problems in FF and IE

10 Answers 165 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kovyar
Top achievements
Rank 1
kovyar asked on 22 Jul 2010, 06:12 PM
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

10 Answers, 1 is accepted

Sort by
0
Missing User
answered on 22 Jul 2010, 11:42 PM
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
0
kovyar
Top achievements
Rank 1
answered on 23 Jul 2010, 09:59 AM
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
0
Accepted
Missing User
answered on 23 Jul 2010, 10:48 PM
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
0
kovyar
Top achievements
Rank 1
answered on 26 Jul 2010, 06:59 AM
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
0
Missing User
answered on 26 Jul 2010, 06:03 PM
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
0
kovyar
Top achievements
Rank 1
answered on 29 Jul 2010, 10:59 AM
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
0
Missing User
answered on 30 Jul 2010, 05:06 PM
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
0
kovyar
Top achievements
Rank 1
answered on 30 Jul 2010, 06:26 PM
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.
0
Accepted
Konstantin Petkov
Telerik team
answered on 10 Aug 2010, 02:00 PM
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
0
kovyar
Top achievements
Rank 1
answered on 10 Aug 2010, 02:03 PM
Hi Konstantin,

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

Thanks,
Yaroslav
Tags
General Discussions
Asked by
kovyar
Top achievements
Rank 1
Answers by
Missing User
kovyar
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or