Unable to find target host (Browser/SilverlightApp) to locate an element

3 posts, 0 answers
  1. Lenore
    Lenore avatar
    5 posts
    Member since:
    Feb 2012

    Posted 20 Feb 2012 Link to this post

    Hi,

    Can you please assist.
     
    We are experiencing the following error 'unable to find target host (Browser/SilverlightApp) to locate an element' after you follow the steps in the test and attempt to run the test.

    We are using version 2011_2_1413.

    Error:
    Overall Result: Fail

    ------------------------------------------------------------

    '2012/02/20 03:06:26 PM' - Using .Net Runtime version: '4.0.30319.239' for tests execution.

    '2012/02/20 03:06:26 PM' - Starting execution....

    '2012/02/20 03:06:26 PM' - Detected a Silverlight Test. Setting EnableSilverlight=True

    ------------------------------------------------------------

    ------------------------------------------------------------

    '2012/02/20 03:06:33 PM' - Using 'InternetExplorer' version '9.0' as default browser.

    '2012/02/20 03:07:18 PM' - 'Fail' : 1. Verify Item0Image's visibility is Visible

    ------------------------------------------------------------

    Failure Information:

    ~~~~~~~~~~~~~~~

    Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: Unable to find the Silverlight plugin on the following page:'about:blank' using the following expression:'[id 'Exact' silverlightControlHost] AND [tagname 'Exact' div][tagname 'Exact' object]'. Exception: ArtOfTest.Common.Exceptions.FindElementException: Element Not found!

       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)

       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait)

       at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)

       at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout, WaitResultType errorResultType)

       at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)

       at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout)

       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.GetHost(IAutomationHost topBrowser, ElementDescriptor element, Int32 hostFindTimeout, Int32 appConnectTimeout, Boolean cachedSLAppOnly, String& error)

    InnerException:

    System.Exception: Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: Unable to find the Silverlight plugin on the following page:'about:blank' using the following expression:'[id 'Exact' silverlightControlHost] AND [tagname 'Exact' div][tagname 'Exact' object]'. Exception: ArtOfTest.Common.Exceptions.FindElementException: Element Not found!

       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)

       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait)

       at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)

       at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout, WaitResultType errorResultType)

       at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)

      at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout)

       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.GetHost(IAutomationHost topBrowser, ElementDescriptor element, Int32 hostFindTimeout, Int32 appConnectTimeout, Boolean cachedSLAppOnly, String& error)

       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost host, AutomationDescriptor descriptor, Int32 timeout)

       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

    ------------------------------------------------------------

    '2012/02/20 03:07:18 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.

    ------------------------------------------------------------

    '2012/02/20 03:07:18 PM' - Overall Result: Fail

    '2012/02/20 03:07:18 PM' - Duration: [0 min: 45 sec: 375 msec]

    ------------------------------------------------------------

    '2012/02/20 03:07:20 PM' - Test completed!

    Thanks
    Lenore


  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 20 Feb 2012 Link to this post

    Hello Lenore,

    If your Silverlight app is in-browser, It looks like the test is simply missing a Navigate to step at the beginning. Therefore it's trying to locate and act upon the Item0Image element when the page isn't actually loaded. You can easily record a Navigate to step and move it to the first position.

    Once that's in place, you might also increase the Silverlight Connect Timeout in Project Settings > Recording Options if your app requires a longer load time. There is also a corresponding setting on the Web tab of Test List Settings.

    All the best,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Lenore
    Lenore avatar
    5 posts
    Member since:
    Feb 2012

    Posted 21 Feb 2012 Link to this post

    Hi Anthony,

    Thanks for the feedback. We made the changes and its working.

    Regards
    Lenore
Back to Top