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

Silverlight Control: Outside bounds of Browser window exception.

15 Answers 158 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mithul Shah
Top achievements
Rank 1
Mithul Shah asked on 08 Jan 2011, 11:06 AM

Hi,

My script is not able to locate a Silverlight control which is inside a RadPanel and it throws Out of bound exception. Here are the steps:

1. I perform a few steps like loading the application, login and other things which are working fine.
2.
I scroll the RadPanel to top of the page and then click it. This expands the RadPanel and here is when the Silverlight Application is loaded. You can now see a Silverlight Hyperlink button. Screenshot name “Step 2”.
3. W
hen I click on the Hyperlink “AddDocumentlink..” the action is recorded and when I try to run the script it doesn’t click this hyperlink and an exception is seen.

The code that is recorded is:
[CodedStep(@"Click AddDocumentLinkHyperlinkbutton", RequiresSilverlight=true)]
        public void AddProduct_CodedStep2()
        {
            // Click AddDocumentLinkHyperlinkbutton 
            Pages.RoadmapGetOnTheMap3.SilverlightApp.AddDocumentLinkHyperlinkbutton.User.Click();
  
     }
Error Message: Exception thrown executing coded step: '[AddProduct_CodedStep2] : Click AddDocumentLinkHyperlinkbutton, RequiresSilverlight=True'.
Exception is:
ArtOfTest.Common.Design.Exceptions.ExecutionException: Exception thrown executing coded step: '[AddProduct_CodedStep2] : Click AddDocumentLinkHyperlinkbutton, RequiresSilverlight=True'. ---> System.InvalidOperationException: Point (223, 1027) outside bounds of browser window: (0, 140, 1366, 565)
   at ArtOfTest.WebAii.Silverlight.UserInteraction.ValidateMouseLocationIfNeeded(Point point)
   at ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)
   at ArtOfTest.WebAii.Silverlight.UserInteraction.Click()
  
at BgRoadmap.AddProduct.AddProduct_CodedStep2() in d:\WebUI Automation\BgRoadmap\AddProduct.aii.cs:line 188
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteSteps(AutomationStepList stepList, TestResult testResult, Object codeBehindInstance)

Please let me know how can I resolve this. Thanks, Mithul.

 

15 Answers, 1 is accepted

Sort by
0
Mithul Shah
Top achievements
Rank 1
answered on 11 Jan 2011, 02:16 PM
Hi Admin,

I am able to click the Silverlight Hyperlink button using this line of code:
Pages.RoadmapGetOnTheMap0.SilverlightApp.OwnerApp.Find.ByAutomationId("AddDocumentLink").User.Click();

But the script is not able to find the element with the below line of code which is auto generated by the WebUI tool.
Pages.RoadmapGetOnTheMap0.SilverlightApp.AddDocumentLinkHyperlinkbutton.User.Click();

I have a work around for this problem but however I would like to know if there is something wrong that I was doing or something wrong with the way WebUI was finding the "
AddDocumentLinkHyperlinkbutton" element and performing the user click action.

Your response would be highly appericated. Please reply. Thanks,

Regards,
Mithul.
0
Keaegan
Telerik team
answered on 12 Jan 2011, 11:26 PM

Hi Mithul,

The best code to use for this setup would be:

ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId("AddDocumentLink").User.Click();

Instead of the working line you provided. This is the more direct way of calling the SL control. Regarding why this isn't working correctly for the original step, we would need to see a copy of the definition within Pages.g.cs (or Pages.g.vb if you are using vb.net) for the object in question (AddDocumentLinkHyperlinkbutton). Can you provide us with a copy of this to review?


Kind regards,
Keaegan
the Telerik team

Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Mithul Shah
Top achievements
Rank 1
answered on 13 Jan 2011, 05:02 AM
Hi Keaegan,

Thanks for your reply. Yes what you suggested you be the right way provided if this is the first SL application in my web page. I would change ActiveBrowser.SilverlightApps()[0] value to ActiveBrowser.SilverlightApps()[1] or [2] depending on the SL application number.

However I will share the Pages.g.cs with you once I am at my work place. To make you understand this issue in a better way, I can give you remote access to my desktop if you have got TeamViewer software at your end and we can talk on call or gtalk at your convenient time.

Please let me know when will you have some free time to look into this issue. Thanks,

Regards,
Mithul.
9885561190.
0
Mithul Shah
Top achievements
Rank 1
answered on 13 Jan 2011, 06:52 AM
Hi Keaegan,

Please find the pages.g.cs file in the attachment. Do let me know incase you need any further information from me. Thanks,

Regards,
Mithul.
+91-9885561190.
0
Cody
Telerik team
answered on 14 Jan 2011, 04:00 AM
Hi Mithul Shah,

Thank you for sending us your Pages file. I took a look and don't see anything obvious. I am curious what would happen if you tried using this like of code instead:

Pages.HttpDemosTelerik.SilverlightApp.OwnerApp.Find.ByExpression(new XamlFindExpression("XamlTag=hyperlinkbutton", "AutomationId=AddDocumentLink")).User.Click();

That is functionally equivalent to:

RoadmapGetOnTheMap0.SilverlightApp.AddDocumentLinkHyperlinkbutton.User.Click();

Is your website publicly available? Can we access it to have a look at this situation?

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Mithul Shah
Top achievements
Rank 1
answered on 14 Jan 2011, 06:23 AM
Hi Cody,

Yes what you mentioned is correct. Both the lines of code should work the same way but unfortunately this is not happening at my end. I am sorry that this app is not available to public but I can show you the behaviour by providing you remote access to my desktop through TeamViewer software.

If you can let me know any convenient time we can have a look at this. Thanks,

Regards,
Mithul.
9885561190.
0
Cody
Telerik team
answered on 14 Jan 2011, 05:24 PM
Hi Mithul Shah,

Did you try the last line of code I sent you? Did it find the element? To summarize we have three lines of code in question:

Pass/Fail? - Pages.HttpDemosTelerik.SilverlightApp.OwnerApp.Find.ByExpression(new XamlFindExpression("XamlTag=hyperlinkbutton", "AutomationId=AddDocumentLink")).User.Click();

Pass - Pages.RoadmapGetOnTheMap0.SilverlightApp.OwnerApp.Find.ByAutomationId("AddDocumentLink").User.Click();

Fail - Pages.RoadmapGetOnTheMap0.SilverlightApp.AddDocumentLinkHyperlinkbutton.User.Click();


We use GoToMeeting as our standard for online meetings. Tuesday next week would work best for me. Let me know what time zone you are in and your availability and I'll setup the meeting. I'm in Austin, TX which is Central Time (GMT -6).

Best wishes,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Mithul Shah
Top achievements
Rank 1
answered on 19 Jan 2011, 08:10 AM
Hi Cody,
Sorry, I was Out of Office for last two days and hence could not try this out. Yes, the last line of code that you have sent worked out. I could find the element and it performed the required action on it. So here is the summary of the lines of code:

Pass - Pages.HttpDemosTelerik.SilverlightApp.OwnerApp.Find.ByExpression(new XamlFindExpression("XamlTag=hyperlinkbutton", "AutomationId=AddDocumentLink")).User.Click();
Pass - Pages.RoadmapGetOnTheMap0.SilverlightApp.OwnerApp.Find.ByAutomationId("AddDocumentLink").User.Click();
Fail - Pages.RoadmapGetOnTheMap0.SilverlightApp.AddDocumentLinkHyperlinkbutton.User.Click();

I work in IST time zone which is GMT +5:30 from 9:00AM to 7:00PM. I am free on any day and if this time is odd then I can stay late in office and we can work this out. Please schedule a meeting at your convenient time and let me know. Thanks,

Regards,
Mithul.
+91-9885561190.
0
Cody
Telerik team
answered on 19 Jan 2011, 11:38 PM
Hello Mithul Shah,

I have emailed you a meeting invite for Monday next week. Check the time in the invite and let me know if you can work with that.

Kind regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Mithul Shah
Top achievements
Rank 1
answered on 24 Jan 2011, 04:55 PM
Hi Cody,

As requested in the meeting, the attached are the DOM Tree of the complete page and the documents panel in two seperate files. Hope this helps you in bebugging the issue. Thanks,

Regards,
Mithul.
0
Cody
Telerik team
answered on 24 Jan 2011, 08:57 PM
Hello Mithul Shah,

Thank you for the files. I have included with bug report 105686. Now we just need to figure out how to repro this problem in-house before we can get to the root cause and fix it.

Best wishes,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Madhu
Top achievements
Rank 1
answered on 15 Jan 2014, 04:34 PM
Hello Cody/Support,

Any updates on this?

I'm getting same error on my silverlight application too. Please see attached video/screenshots. Trying to click on "Field Chooser", but no luck. Using 2013.2.1219.0 standalone version.

Failure Information: 
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[Selection_Field_Chooser_on_Portfolio_Holdings_CodedStep] : Coded Step'.
InnerException:
System.InvalidOperationException: Point (1073741824, 1073741824) outside bounds of browser window: (0, 53, 1280, 943)
You might need to maxmize the browser while running this test. Try adding the following code in a coded step: ActiveBrowser.Window.Maximize();
   at ArtOfTest.WebAii.Silverlight.SilverlightApp.ValidateMouseLocation(Point point)
   at ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)
   at ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType)
   at CodedStepsProj.Selection_Field_Chooser_on_Portfolio_Holdings.Selection_Field_Chooser_on_Portfolio_Holdings_CodedStep() in C:\TrunkBuildScripts\HoldingBrowserVsCashBrowser_Vrfy\Sub Actions\Selection Field Chooser on Portfolio Holdings.tstest.vb:line 46

Piece of code:
Public Sub Selection_Field_Chooser_on_Portfolio_Holdings_CodedStep()
            ActiveBrowser.Window.Maximize()
            Dim ClickOnFieldChooser As TextBlock = Pages.SentryAuditTrailSessions0.SilverlightApp0.GearDropDownPopupBorder.Find.ByTextContent("Field Chooser").[As](Of TextBlock)()
            ClickOnFieldChooser.User.Click(MouseClickType.LeftClick)
        End Sub

Thanks,
Madhu





0
Velin Koychev
Telerik team
answered on 20 Jan 2014, 12:21 PM
Hello Madhu,

I am sorry to hear you are experiencing this issue.

Without being able to see the problem first hand, it's hard to say for certain what you need to do to fix this problem. My first guess is you need to add a "Scroll to visible" step for the target element in failing test step. You can try with the following code:

Public Sub Selection_Field_Chooser_on_Portfolio_Holdings_CodedStep()
            ActiveBrowser.Window.Maximize()
            Dim ClickOnFieldChooser As TextBlock = Pages.SentryAuditTrailSessions0.SilverlightApp0.GearDropDownPopupBorder.Find.ByTextContent("Field Chooser").[As](Of TextBlock)()
            ClickOnFieldChooser.ScrollToVisible()
            ClickOnFieldChooser.User.Click(MouseClickType.LeftClick)
        End Sub

If the issue persists please give us a direct access to the application so we can reproduce the problem on our end and give you a solution.

Hope to hear from you soon.

Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Dadu
Top achievements
Rank 1
answered on 24 Oct 2014, 01:02 PM
I receive the same error while trying to click on a Silverlight hyperlinkbutton element. The element is visible on the screen.

Any updates?

{"Point (1073741824, 1073741824) outside bounds of browser window: (0, 55, 1920, 1105)
You might need to maxmize the browser while running this test. Try adding the following code in a coded step: ActiveBrowser.Window.Maximize();"}

at ArtOfTest.WebAii.Silverlight.SilverlightApp.ValidateMouseLocation(Point point)
at ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)
at ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType)
at ArtOfTest.WebAii.Silverlight.UserInteraction.Click()
at TelerikWebAutomation.Program.FirstTest(List`1 langInput)
0
Boyan Boev
Telerik team
answered on 29 Oct 2014, 01:29 PM
Hello Dragos,

What version of Test Studio do you use? You can try installing our latest internal build (1016) and give it a try.

You can download it from here.

You can also try adding scroll to visible step even it is visible on the screen, just for testing purposes.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Mithul Shah
Top achievements
Rank 1
Answers by
Mithul Shah
Top achievements
Rank 1
Keaegan
Telerik team
Cody
Telerik team
Madhu
Top achievements
Rank 1
Velin Koychev
Telerik team
Dadu
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or