Telerik Forums
Testing Framework Forum
23 answers
425 views
Hi guys,

I’m getting “Wait for condition has timed out” exceptions when calling LaunchNewBrowser. The strange thing is that this problem doesn't happen all the time (except in one case, see below).

Stacktrace:
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Core.Manager.WaitForBrowserToConnect(Int32 browserIndexToWaitFor)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect)

Things to note about our setup:

1.    We are using Telerik Testing Framework 2011.1 (2011.1.609). However, this problem also happened when we were running version 2010.1.

2.    On most of our servers (a mix of Server 2003, 2008, 32 bit, 64 bit, IE8, IE9) we’re getting this message regularly, but not all the time. Roughly, 80% of the time there is no problem, 20% is showing this exception (or similar problems). Usually, it helps to just retry calling .LaunchNewBrowser, but not always.

3.    When this happens, a new browser is started and visible without any delays, but Telerik Testing Framework is not able to connect to it (see below).

4.    As of today, we have one new Server 2003 which always displays this behavior. This server has never had an earlier version of Telerik Testing Framework, but when I install the version we used previously (2010.1), we’re seeing normal behavior (80% OK, 20% error).

5.    I’m including a snippet of our application’s trace log.

Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Process launched (ID=5460, Path="\Device\HarddiskVolume1\Program Files\Internet Explorer\IEXPLORE.EXE", Arguments="-nomerge about:blank").
Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Attempting to attach on IE frame (HWND=197334)...
Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Process "URLTester" (ID=2728) is assumed to host the controller.
Uncategorized: Connector.InjectCode() : ------- Function Start 'Connector.InjectCode' -------
Uncategorized: Connector.InjectCode() : Connection string: C:\WINDOWS\assembly\GAC_MSIL\ArtOfTest.InternetExplorer\2011.1.609.0__5339893a7cefe4d6\ArtOfTest.InternetExplorer.dll?ArtOfTest.InternetExplorer.ArtOfTestPluginEntryPoint?2728
Framework: InternetExplorerActions.WaitForDocument() : Attempting to get IHTMLDocument2 from Internet Explorer HWND 197334 on another thread...
Uncategorized: <>c__DisplayClasse.<WaitForDocument>b__7() : Attempting to get document from window handle
Framework: InternetExplorerActions.WaitForDocument() : IHTMLDocument2 successfully retrieved.
Framework: Connector.InjectCode() : Sending WM_COPYDATA to HWND 197334 (lpData = "C:\WINDOWS\assembly\GAC_MSIL\ArtOfTest.InternetExplorer\2011.1.609.0__5339893a7cefe4d6\ArtOfTest.InternetExplorer.dll?ArtOfTest.InternetExplorer.ArtOfTestPluginEntryPoint?2728")...
Framework: Connector.InjectCode() : Returned from sending WM_COPYDATA (LRESULT=0, GetLastError()=DS_S_SUCCESS).
Uncategorized: Connector.InjectCode() : ------- Function End 'Connector.InjectCode' -------
<The exception occurs after this point>

6.    If I compare this with the log of regular (correct) cases, I'm missing this part:

Framework: BrowserProvisioner.ServiceThread() : A new client has connected to the provisioning pipe.
Framework: BrowserRemoted.AsyncListenerThreadEntry() : Not connected; this will now wait indefinitely for a pipe client connection...
Framework: BrowserRemoted.AsyncListenerThreadEntry() : A new client has connected to the pipe.
Framework: BrowserRemoted.AsyncListenerThreadEntry() : Now waiting indefinitely for a command from the pipe client...
Framework: Manager.AddNewBrowser() : Added client ID "Client_81b0ef79-6ece-4f38-97e1-1332561eab77" (now there is/are 1 total).
Framework: Connector.InjectCode() : Returned from sending WM_COPYDATA (LRESULT=0, GetLastError()=DS_S_SUCCESS).
Uncategorized: Connector.InjectCode() : ------- Function End 'Connector.InjectCode' -------

7. Therefore, either the client is not connecting through the pipe, or BrowserProvisioner.ServiceThread() isn't running. I looked at the internal ArtOfTest.WebAii code using JustDecompile, in order to try and understand what is happening, but I haven't been able to figure out which code is calling BrowserProvisioner.ServiceThread.

8. I have tried disabling the Named Pipes restriction in Local Security Policies, but this doesn't seem to make any difference, and it wouldn't explain why the problem occurs *some* of the time.

9. Obviously, our servers and browsers are configured as per Telerik's documentation.


Apologies for this long message. We would really like to get some more control over this problem, as it would greatly improve the stability of our software. Please let us know if you need more information. Thanks very much in advance.

Kind regards,
JP
Peter
Top achievements
Rank 1
 answered on 13 Nov 2011
7 answers
415 views
I need to iterate over the rows of a Silverlight RadGridView checking for duplicates and the total count.  I adapted the sample from http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/code-samples/silverlight/radgridview/scrolling.aspx.  I test against the telerik sample page here: http://demos.telerik.com/silverlight/#GridView/PagingLargeData.

I expect to get a row count on the first page of 100 and examine each row once.  Instead, I get a row count of ~120 (it changes between runs) and several rows seem to appear twice and/or out of order.  For example, the last row I print out is "83, Maxilaku, $45.60, 5/12/2008, ". How can I accomplish my goal of examining each and every row of the current RadGridView page in the order they appear in the grid and once and only once?

I am using Test Framework 2011.2.928.0 and Silverlight 4.0.60831.0.

My code follows.
Thanks,
Ken
[Test]
public void SampleWebAiiTest()
{
    Settings.Current.Web.EnableSilverlight = true;
 
    // Launch a browser instance
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
 
    // The active browser
    ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/PagingLargeData");
 
    SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
 
    int verticalOffset = 0; // Holds the current vertical offset in the viewport
    int viewPortHeight; // The height of the visible part of the grid
    int extentHeight; // The total height of the grid, visible plus non-visible
 
    // Copy the RadGridView into a local variable as a shortcut
    RadGridView grid = app.Find.ByAutomationId<RadGridView>("GridView");
 
    // Grab the VirtualizingPanel contained in the RadGridView. This is used to control the viewable portion of the grid.
    FrameworkElement virtualizingPanel = grid.Find.ByType("GridViewVirtualizingPanel");
 
    // Detect the view port height and the extent height
    viewPortHeight = (int)virtualizingPanel.GetProperty(new AutomationProperty("ViewportHeight", typeof(int)));
    extentHeight = (int)virtualizingPanel.GetProperty(new AutomationProperty("ExtentHeight", typeof(int)));
 
    // Make sure it is scrolled to the very top
    // Walk through the entire grid verifying the data
    virtualizingPanel.InvokeMethod("SetVerticalOffset", 0);
 
    int index;
    int totalCount = 0;
    string rowText;
    while (verticalOffset < extentHeight)
    {
        foreach (GridViewRow r in grid.Rows)
        {
            totalCount++;
            index = r.Index;
            rowText = string.Join(", ", r.Cells.Select(item => item.Text));
        }
        // Scroll down one page
        verticalOffset += viewPortHeight;
        virtualizingPanel.InvokeMethod("SetVerticalOffset", verticalOffset);
    }
}
Cody
Telerik team
 answered on 12 Nov 2011
1 answer
100 views
I hope that this is possibly a simple question.  I am using 2011_2_9_28 and just trying to execute some tests that validate the selected text in the browser.  I was unable to get it working.

Here is a basic console app that does not display text in any of the browsers that I tried.  I would just launch it and then select various things on the page including text in the search box and GetSelectedText() is always empty.  Am I using it wrong?

Manager testManager = new Manager(false);
testManager.Start();
testManager.LaunchNewBrowser(BrowserType.InternetExplorer, true);
testManager.ActiveBrowser.NavigateTo("http://google.com");

for (int i = 0; i < 20; i++)
{
	Console.WriteLine("Current: " + testManager.ActiveBrowser.GetSelectedText());
	Thread.Sleep(1000);
}

Console.ReadLine();
testManager.Dispose();
 

Anthony
Telerik team
 answered on 11 Nov 2011
1 answer
116 views
Hi,

When I run performance testing of the our web application I get results which you can see at the attachment.
At functional testing I put 500 ms execution delay twice. But performance testing says first one's total time 1250ms and second one's 1796ms. 
How can we read performance testing result? 
Anthony
Telerik team
 answered on 10 Nov 2011
3 answers
67 views
Hi Telerik,

If I am recording a new test then everything including typing to text boxes is captured by recorder. I am recording Silverlight application.

However if I replay already recorder steps by Run->To Here by mouse right click within the test then:
- steps are repeated well based on recording
- then Test Studio with small bar is attached and I am ready to record next steps
- steps are recorder OK like mouse click etc.
- no typing inside text boxes or other controls is recorded.

Nothing helps what I tried. One and only workaround is to start with empty test and then copy and paste recorded steps to old test. It is quite tricky to do it especially within big test.

Any idea? I am using 2011.2.928.0.

Best regards,
Dalibor
Anthony
Telerik team
 answered on 08 Nov 2011
3 answers
158 views
Hi Telerik,

1. I have test 1 which opens a web page and types login name and password into my Silverlight application.
2. I have test2 which calls test 1 as a first step.
3. I have test3 which calls test 2 as a firts step.
4. I have a test4 which makes 5 times loop over test 3.

When I run test1 then it works.
When I run test2 (which calls test 1) then it works.
When I run test3 (which calls test 2 which calls test 1) then it works.
But when I run test4 which calls test 3 in loop then it fails.
Test 4 does
- loop
- calls of test3
- test 3 calls test2
- test2 calls test1. This opens a browser with my Silverlight application. Then second step (typing to login text box) fails with message Timeout trying to connect Silverlight application.

Any idea? I am using 2011.2.928.0.

Best regards,
Dalibor
Plamen
Telerik team
 answered on 08 Nov 2011
1 answer
168 views
Hello, 

I'm developing a WPF desktop application
How could I create an AlertDialog and add a special handling to it.
the problem is the AlertDialog needs a Browser , but I'm working on WPF desktop app!!
any help !!
Plamen
Telerik team
 answered on 04 Nov 2011
5 answers
255 views
Hello,

Do you plan to have this documentation back, Online or Offline?
For my part, I often refer to it to learn correctly the framework.

Thanks.
Anthony
Telerik team
 answered on 03 Nov 2011
1 answer
128 views
In the web app I am testing against I've got the element:

<form name="aspnetForm" id="aspnetForm" onsubmit="javascript:return WebForm_OnSubmit();" action="default.aspx" method="post" sizcache="10" sizset="0">

The following code:

Element element1 = Find.ById("aspnetForm");
Element element2 = Find.ByXPath("//form[@id='aspnetForm']");
Element element3 = Find.ByXPath("//form[@name='aspnetForm']");

returns element1 as correct found element, wheras element2 and element3 are nulls. What is the reason for that?

IE8, WinXP.
Anthony
Telerik team
 answered on 25 Oct 2011
1 answer
121 views
HI,

I have a WPF application I want to test with Test Studio, but I'm havieng some problems to handle an Alert Dialog. In the application, i click a button to save my changes and a popup window appears to inform that changes had been saved. It contains nothing but a label and an OK button. If I execute the test from the VS plugin, it works, but when i generate code form that test these lines are created to handle the alertdialog:
// Handle 'Generic' dialog.
          GenericDialog genericDialog = new GenericDialog(ActiveBrowser, "Modeling Scenario", true, "Submit Completed Successfully");
          genericDialog.ButtonId = 2;
          Manager.DialogMonitor.AddDialog(genericDialog);

The problem is that I don't have any ActiveBrowser, Instead I do have an ActiveApplication, but GenericDialgon needs an 'ArtOfTest.WebAii.Core.Browser' variable while ActiveApplication is an 'ArtOfTest.WebAii.Wpf.WpfApplication'.
I alos tried other posibilities like AlertDialog or ConfirmDialog, but I ended with the same problem. Can you help me please? Which is the correct class i should use for a WPF message box?
Anthony
Telerik team
 answered on 25 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?