Quantcast
Channel: Silk Test - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 625

Could not find object ‘//BrowserWindow'; Unable to get URL from browser.

$
0
0

Hi,

Please can someone help with the issue below, were unable to playback recorded test scripts because it looks like silk test gets confused when multiple instance of Internet Explorer are active.

Summary:

Playback error is thrown “Could not find object ‘//BrowserWindow’” when trying to get URL value from a running “BrowserApplication”.

 

Background: 

We are recording user actions via the Visual Studio recording plugin within a C# solution. When working with two internet explorer instances the recording is getting confused creating lots of  “BrowserApplication” objects which cause playback to fail. To remedy this I wrote some code to explicitly find the correct browser instance and use it before performing the user action.

While investigating and debugging the issue in more details, i found the following:

Issue1:

When a list of “BrowserApplication” contains more than one “BrowserApplication” object, the SilkTest playback throws and “Could not find object ‘//BrowserWindow’” an error when trying to get the URL value from the lastBrowserApplication” in the list.

Issue2:

When a list of “BrowserApplication” contains more than one “BrowserApplication” object, the wrong URL is returned from the selected “BrowserApplication”, as long as the browser object is "NOT" the last one being accessed.

 Repro steps:

Open three instance of IE11, 

ie1: www.google.co.uk

ie2: www.yahoo.co.uk

ie3: www.bbc.co.uk

The test method below will cause the issue to repro:

Run the following code from visual studio 2015:

        [TestMethod]

        public void trythis()

        {

            Desktop dt = Agent.Desktop;

            //List<BrowserApplication> list = new List<BrowserApplication>();

 

            foreach ( BrowserApplication b in dt.FindAll("/BrowserApplication") )

            {

                  //list.Add(b);

b.SetActive();

msgbox(b.BrowserWindow().GetUrl()); //it index =0 the correct url is returned.

            }

 

        }

 

Results:

ie_object[0] returns ie_url[0]

ie_object[1] returns ie_url[2]

ie_object[2] does not return anything because the playback throws an error: “Could not find object ‘//BrowserWindow” 

Environment:

Win7-x64-Pro,

IE11,

Visual Studio 2015 Community Edition,

SilkTest4Net v17.0 (Evaluation version)


Viewing all articles
Browse latest Browse all 625

Latest Images

Trending Articles

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>