Telerik Forums
Testing Framework Forum
3 answers
133 views
Hi,

I'm trying to evalute the Telerik testing framework for silverlight automation.I'm running into a few issues.
Following is the sample code that I am using.
Settings settings = GetSettings();
settings.Web.DefaultBrowser = BrowserType.InternetExplorer;
settings.Web.EnableSilverlight = true;
 
Initialize(settings, new TestContextWriteLine(this.TestContext.WriteLine));
 
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo("http://localhost/TestSLAppTestPage.html");
ActiveBrowser.WaitUntilReady();
 
var slApp = ActiveBrowser.SilverlightApps()[0];
Assert.IsNotNull(slApp);
 
var button = slApp.FindName<Button>("button1");
Assert.IsTrue(button.Text.Equals("Click Me"));

 

When I run this test it passes but I am unable to debug it. When I put a breakpoint at ActiveBrowser.SilverlightApps line and try to evaluate the object returned by the method it gives an error saying that Function evaluation timed out. and Function evaluation disabled because a previous function timed out.

Also i see the following exception in the output.

Error: PipeCommunication.AsyncPipeRead() : EXCEPTION ("Pipe Null State: False")

Type: System.Threading.ThreadAbortException

Message: Thread was being aborted.

Call Stack:

at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)

at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)

at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)

at System.Threading.WaitHandle.WaitOne()

at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.AsyncPipeRead(PipeStream pipe, Byte[] bytes, Int32 offset, Int32 count)

The program '[7604] QTAgent32.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).


I am using Testing framework version 2011.1.817 that is in beta. I also tried the 2011.1.712 version. I encountered similar issues.
Does the framework support XBAP automation?

Thanks.
Regards,
Arooj
Anthony
Telerik team
 answered on 29 Aug 2011
17 answers
403 views
I have been trying to get some unit tests (VS2010) to work that deal with confirm message boxes.  In short, I have two tests that use the MouseClick() function to click a button that brings up a message box in IE8.  I found code on-line regarding using the Manager.Current.DialogManager.AddDialog method.  In my first test I call an inactivate button and an activate button, both call the confirm and the test works.  In the second test, I call a delete button which calls a confirm message box, and this is where I am having issues.  If I run both tests individually, using VS2010, my code works.  If I run both tests together, the first test works (with the inactivate and activate buttons) but the second test (with the delete button) does not work.  The code errors out on the confirmDialog.WaitUntilHandled(); method.

Basic code I am using is as follows:

 

 

ConfirmDialog confirmDialog = ConfirmDialog.CreateConfirmDialog(Manager.Current.ActiveBrowser, DialogButton.OK);

 

confirmDialog.HandlerDelegate = new DialogHandlerDelegate(this.ConfirmHandleDialog);

Manager.Current.DialogMonitor.AddDialog(confirmDialog);

Manager.Current.DialogMonitor.Start();

 

// Click the button

this.Action.MouseClickItem(RSSControls.Applications.ApplicationsEditLoginPage.DeleteQuestion);

confirmDialog.WaitUntilHandled();

 

Manager.Current.DialogMonitor.RemoveDialog(confirmDialog);

Manager.Current.DialogMonitor.Stop();

 

 

private void ConfirmHandleDialog(IDialog dialog)

{

ArtOfTest.WebAii.Win32.Button b = new ArtOfTest.WebAii.Win32.Button(dialog.Window, "OK", false);

 b.Click();

dialog.HandleCount = 1;

 Manager.Current.DialogMonitor.RemoveDialog(dialog);

}

Am I doing something incorrect?  The tests work correctly when I run them individually but when I run them together the second test does not work.  The message box confirmation box pops up, but it never gets handled.  I have looked all over the internet and found several examples of how to use this feature, however I am still having problems.

Also, does this function work in IE7?  It appears to not work at all when I test my tests against an IE7 machine.

Cody
Telerik team
 answered on 26 Aug 2011
1 answer
144 views
Hi,

We are implementing generic functions for click operations on the Silver light objects.
But, we are unable to write the proper code in C#, please refer below code and help.

We have tried below functions without any success.

1. myManager.ActiveBrowser.Find.ByName<HtmlControl>(objID).Click();  -- Not working
    myManager.ActiveBrowser.SilverlightApps()[0].RefreshVisualTrees();

2. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByExpression(@"XamlPath=/grid[name=RootElement]/border[name=ChartBorder]/grid[name=ChartAreaGrid]/grid[name=CenterOuterGrid]/grid[name=CenterGrid]/grid[name=CenterInnerGrid]/grid[name=PlotAreaGrid]/scrollviewer[automationid=PlotAreaScrollViewer]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/canvas[name=PlotCanvas]/canvas[name=DrawingCanvas]/canvas[0]/canvas[0]/canvas[0]/canvas[0]/path[12]",true).User.HoverOver();

3.  myManager.ActiveBrowser.SilverlightApps()[0].Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Path>('Uid="66208306"').User.HoverOver();   -- Not Working..

3. This works when we hover manually on the silver light object to fetch the tool tip value.
string myToolTipVal = STEPForTestStudioclass.myManager.ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId<TextBlock>("ToolTipTextBlock").TextContent;  --> Works fine.

But we need some generic function which will click when we pass the object ID/name/Automation ID of the silver light control.

FYI: While recording and play back it works fine, but we don't want to use that descriptive code but would like to create
some generic functions if possible.

Regards
Tapan
Cody
Telerik team
 answered on 25 Aug 2011
3 answers
156 views
Hi,

I'm experiencing quite strange behavior in terms of log creation. I can reproduce it on win 2003 32bit and Win XP 32bit too. It was fine until I migrated to new machines with same OS. I can see in debug mode (Visual Studio 2010), folder path and log file name gets generated and is kept in settings. I just don't see file physically created on disc drive and all writes to log can be seen in Immediate window like e.g.:

Uncategorized: Log.WriteLineInternal() : Starting execution of: TestCase000

,but doesn't brake execution. 

Any ideas please?

Thanks, David.
Plamen
Telerik team
 answered on 22 Aug 2011
6 answers
134 views
Hi,

I have code that successfully locates a RadExpander control on a Silverlight page using the FindName method of SilverlightApp class.  When I try to cast the resulting FrameworkElement to a RadExpander I get the following error:

  • The control type 'ArtOfTest.WebAii.Siliverlight.UI.ToggleButton' does not match the xaml tag 'radtogglebutton'

Here is some code that represents what I'm trying to do:

  • FrameworkElement element = app.FindName(controlName);
  • RadExpander expander = element.As<RadExpander>();

Any clues on why this is happening.  

Thanks.

Joel
Cody
Telerik team
 answered on 19 Aug 2011
7 answers
420 views

Hello Admin,

I am testing  a Silverlight application with .NET 4.0 Framework, We have a functionality like AttachSignature, Which Invokes windows open dialogue to attach the jpeg signature. This testing need to be automated using Telirk webaii Framework, I do not have any methods to test for this test case. Can you please help me with anything ….

Abi
Top achievements
Rank 1
 answered on 17 Aug 2011
2 answers
101 views
Hi,

My problem is that we have aTest.cs and a.cs.
a.cs contents a variable which will be used until the all testmethods under aTest.cs are finish, but after the first test method the variable is set to null so the remaining test methods will become failed.

Thank you.


 
wilfredo
Top achievements
Rank 1
 answered on 17 Aug 2011
11 answers
267 views
I'm running into an issue when trying to run a sample on my Win 7 x64 environment.  I'm attempting to run this sample:

[TestMethod]
[Description("Detect images as they arrive from the web server")]
public void ImageDetection()
{
    Manager.Settings.Web.UseHttpProxy = true;
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
 
    ResponseListenerInfo li = new ResponseListenerInfo(CheckTypeForImage);
 
    Manager.Http.AddBeforeResponseListener(li);
    ActiveBrowser.NavigateTo("http://news.google.com/");
    Manager.Http.RemoveBeforeResponseListener(li);
 
    // Check the test results for a log of all responses during the page load
}

when I hit the line Manager.Http.AddBeforeResponseListener(li); I get this exception:

System.IO.IOException was unhandled by user code
  Message=Pipe is broken.
  Source=System.Core
  StackTrace:
       at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
       at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.WriteCommandToPipe(PipeCommand command, PipeStream pipe, Boolean waitForDrain)
       at ArtOfTest.WebAii.Messaging.Http.HttpProxyManager.AddBeforeResponseListener(ResponseListenerInfo info)
       at QuickStarts_VSTS_CS.WebAii2Samples.ImageDetection() in C:\Program Files (x86)\Telerik\Testing Framework 2011.1\Samples\Testing Framework\QuickStarts_VSTS_CS\Tests\WebAii2Samples.cs:line 169
  InnerException:

If I run this same sample on my Win 7 x86 VM, it works fine.  Any ideas on what I have to do to get it to work in my x64 environment?

I'm running version 2011.1.712.0.

Thanks!
Cody
Telerik team
 answered on 16 Aug 2011
1 answer
117 views
Hi,
  We have a website that I am trying to automate. Basically there is a Html Input File control and its textbox is disabled. I need to click on its 'browse' button, navigate to the right file location and open a file. Once this is done, I need to upload this file.

We have been using WebAii 2010.2 version for our automation. We wont be able to upgrade to the newer version of the webaii suite. I managed to get this automated and everything seems to work fine on IE8 in Windows 7. But When I try to run this on IE9 on Windows 7, the file dialog opens and then right away closes. below is my code snippet

         
      #1      _manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
            _manager.DialogMonitor.AddDialog(new FileUploadDialog(_manager.ActiveBrowser, fileNameToUpload, DialogButton.OPEN, "Choose File to Upload"));
            _manager.DialogMonitor.Start();
            _manager.ActiveBrowser.WaitUntilReady();
            HtmlInputFile updlg = _manager.ActiveBrowser.Find.ById<HtmlInputFile>("ctl00_MainContent_FileUpload1");
       #2     updlg.Click();

when I comment line #1, the dialog opens and right away closes. When I leave line #1 uncommented, then the dialog opens, after a couple of secs, it flickers,
then it flickers, then it stays there forever without moving to the next line of code.

for line #2, updlg.MouseClick() doesnt seem to do anything.


But all of this works fine in IE8!!! Can you guys tell me if there is any way this can be made to work in IE9? If that
is not possible, then is there an Add on for newer versions for Firefox?

When I try firefox, I see it open the window, but nothing happens and the address bar has this text: "about:blank?!!AOT2.0!Pipe.ArtOfTest.WebAii.BrowserProvisioner_517858088"



Am i missing some steps in setting up firefox?


Anthony
Telerik team
 answered on 15 Aug 2011
1 answer
123 views
I've recorded my Out-of-Browser Test and when I execute this written Test I get an Exception at the last Step.
I get this Exception on 2 Different Programms and everytime it runs threw all of the Steps clearly but stucks on that last Step.

The Exception is an Unsupported Browser Exception.
But I have selected and executed an Out-of-Browser Test.

What am I doing wrong ?


Have to edit that it is not that last step everytime.
Stoich
Telerik team
 answered on 15 Aug 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?