Telerik Forums
Test Studio Forum
1 answer
103 views
Using the code provided to make a custom Dialog handler, I am now trying to capture the Alert dialog as a screenshot and have been unsuccessful using both Manager.ActiveBrowser.Capture() and Manager.ActiveBrowser.Window.GetBitmap().  Both attempts save the window behind the Alert dialog.

Any help would be appreciated!

public override void OnBeforeTestStarted()
{
    AlertDialog myAlertDialog = new AlertDialog(ActiveBrowser, DialogButton.OK);
    myAlertDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomAlertHandler); 
    //Manager.DialogMonitor.AddDialog(new AlertDialog(ActiveBrowser, DialogButton.OK));
    Manager.DialogMonitor.AddDialog(myAlertDialog);
    Manager.DialogMonitor.Start();
}
public void MyCustomAlertHandler(IDialog dialog)
{
    // Simply close the dialog 
    System.Threading.Thread.Sleep(1500);
    System.Drawing.Bitmap image = Manager.ActiveBrowser.Capture();
    //System.Drawing.Bitmap image = Manager.ActiveBrowser.Window.GetBitmap();
      
    image.Save(this.ExecutionContext.DeploymentDirectory.ToString() + @"\Data\alert.png", System.Drawing.Imaging.ImageFormat.Png);
    dialog.Window.Close();
    try
    {
        // Wait until it is closed 
        dialog.Window.WaitForVisibility(false, 50);
        Log.WriteLine("Alert Handled!");
    }
    catch
    {
        Log.WriteLine("Failed to handle alert!");
    }
}
Daniel
Top achievements
Rank 2
 answered on 13 Sep 2013
8 answers
131 views
This issue was found when I was testing my other thread, http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/javascript-message-box-handling.aspx, in regards to dialog handling on IE7.  The latest internal build, 111.8.29.0, appears to have resolved my dialog handling issue on IE7 machines.  However I know am getting a different error on a couple of my tests, regardless of version of Internet Explorer (IE7 or IE8), when running the automated tests through MSTest on a controller/agent evironment.  Note, this tests work on my computer when running through Visual Studio 2010.  Also, I still have the issue that my one application does not work on the latest buid because of the popup blocker check is causing IE to reload, which causes my tests to fail, this is another open thread I have created.

The error:
Test method AgencyTestAutomation.RSSTest.RSS_SkillsTabAddChecklistScales threw exception: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed! BrowserCommand (Type:'Action',Info:'NotSet',Action:'Click',Target:'ElementId (tagName: 'input',occurrenceIndex: '6')',Data:'',ClientId:'Client_a059478c-adc9-4943-a6db-cb91d0aa7f2d',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'') InnerException: System.Runtime.Serialization.SerializationException: End of Stream encountered before parsing was completed. at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at ArtOfTest.WebAii.Messaging.Process.PipeCommand.FromBinary[T](Byte[] bytes) at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.ReadCommandFromPipe[T](PipeStream pipe) at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId) at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request) ---> System.Runtime.Serialization.SerializationException: End of Stream encountered before parsing was completed.



Appears to be failing when I am clicking on an HtmlInputButton control, that causes the pop up browser window to be closed.  It consistently fails on these two tests, and I have other tests with similar code.  Any idea on what I can do to troubleshoot this issue?
Velin Koychev
Telerik team
 answered on 13 Sep 2013
8 answers
158 views
So I'm on the latest R1 2013 Release now.  I have some scheduled jobs that are not processing.
How can I delete the scheduled jobs?  
Herb
Top achievements
Rank 1
 answered on 12 Sep 2013
6 answers
339 views
I apologize, I'm sure this has been asked and I promise you I spent the better part of the morning searching for an answer.

I'm using a combination of Test Studio standalone and Visual Studio for the code behind.

Scenario:

Have a series of Web Test's (recorded steps and scripted steps (Utility Class)) that go out and collect baselines based off tables on a website and export them to CSV files in the Data directory of the project.

Have another series of Web Test's that are simply scripted steps that compare the baseline to another generated file. 

I've written a small WPF application that enumerates the directory containing the CSV files and simply asks the user which one they would like to compare to the baseline with.

I am able to open the WPF application using the Manager.LaunchNewApplication along with a bunch of other settings.  I can make assertions based on the contents of the WPF app, however the manager does not wait for the application to close and test continues through steps.

Is there a way that I am missing that would allow the Manager to wait for the WPF application to close?  I am sure it is simple (I am newer to programming versus system admin scripting), I am just missing it.  Using the latest public build of Test Studio.

Below is a super stripped down version of what I am trying to accomplish.

public static class PCCSR
{          
    public static string root = ExecutionContext.Current.DeploymentDirectory + @"\Data\";
     
    public static void NSRtestWPF()
    {
        Manager.Current.LaunchNewApplication(root + @"PCCNSR.exe", "Admin");
        ListBox b = Manager.Current.ActiveApplication.MainWindow.Find.ByName<ListBox>("lstbxFiles");
        Assert.IsTrue(b.Items.Contains("Baseline_Security_Roles_Admin.csv"), "File not found");
    }
}

I have looked at http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/wpf/connect-to-running-wpf-app.aspx along with searching the forums.
Daniel
Top achievements
Rank 2
 answered on 12 Sep 2013
11 answers
185 views
I can't seem to connect TestStudio TFS to my visualstudio.com tfs portal

Has anyone tried this?
Cody
Telerik team
 answered on 11 Sep 2013
7 answers
170 views
This seems to be some kind of default behaviour whereby typing characters first backspaces all the existing text.  I don't want that as it breaks my functionality.  Think of an intellisense box where you type, pick something from a popup, type some more.
Shashi
Top achievements
Rank 1
 answered on 11 Sep 2013
2 answers
100 views
I am trying to understand how I can use the element explorer to better handle change in our tests but I seem to be missing a few things. When I look in our EE(Element Explorer) there are many duplicates such as: "Overview", "Overview0", "Overview00" . When I click on them I see different baseurls and Paths, although they are all for the same logical page. I also see the same thing inside the "Overview" entry with duplicates inside that for the individual elements. I thought I was combining the pages by changing all the base urls and the paths to the same thing, but they keep reverting back to what they were. What is the best practice to clean up all the duplicate elements? Also is their any additional information on the properties, as I didn't see anything specific in the online documentation.
Thanks
John
John
Top achievements
Rank 2
 answered on 11 Sep 2013
10 answers
211 views
 We are setting up our automated test structure.  We have found that we will be using test as step quite extensively.  With our current structure all tests for a particular function are in one area, i.e. login.  Consequently we have on Test and all of the tests it uses in one folder.  This will quickly lead to lots of confusion, which tests call the others and which are called, as the number of tests grow.
 I thought of having all the master tests at one project level with the tests as step as a sub-project.  This won't make it obvious which tests call which test as step.
 Is there a better way or some feature I'm missing that will solve this problem better?

Thanks tor your help,
Gregg
Ivaylo
Telerik team
 answered on 11 Sep 2013
1 answer
85 views
HI,

I'm trialing this product and while I think its very good the crashing is annoying as it happens behind the browser window.  For example, you are recording a test and unknown to you (because the popup is behind the browser) TestStudio has crashed.  You happily continue recording steps and at the end click back to TestStudio to find it has crashed with the Save Project dialog open, all your recording steps are lost.  Difficult to make the software bug free but it would help if there was some notification in the recording toolbar so that you didn't waste your time.

Crash below:

[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for RadWatermarkTextBox TargetKey1
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : AutomationId=PART_DateTimeInput,XamlTag=radwatermarktextbox
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyUp() : Keyup received from Silverlight app
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyDown() : Keydown received from Silverlight app
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Uncategorized] XamlIntrinsicTranslator.IsCharacterKey() : Right IS NOT a character key
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function Start -------
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] WebRecordingSurfaceManager.PreRecordDescriptors() : Transitioning to ReadyToEdit state
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for RadWatermarkTextBox TargetKey1
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : AutomationId=PART_DateTimeInput,XamlTag=radwatermarktextbox
[09/07 11:46:47,IEXPLORE.EXE(8292:53),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:46:47,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:46:48,Telerik.TestStudio.exe(5108:1),Error] App.LogUnhandledException() : EXCEPTION! (see below)
     Situation: Unhandled exception!
     Outer Exception Type: System.NullReferenceException
     Message: Object reference not set to an instance of an object.
     HRESULT: 0x80004003 (Official ID (if app.) = E_POINTER, Error Bit = FAILED, Facility = FACILITY_NULL, Code = 16387)
     Call Stack:
          at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.DetermineBinding(PropertyGridField field)
          at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.<>c__DisplayClass3.<OnUpdateBindingOnElementLoaded>b__0(Object s, RoutedEventArgs args)
          at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
          at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
          at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
          at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
          at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
          at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
          at MS.Internal.LoadedOrUnloadedOperation.DoWork()
          at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
          at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
          at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
          at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
          at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
          at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

[09/07 11:46:48,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyDown() : Keydown received from Silverlight app
[09/07 11:46:48,IEXPLORE.EXE(8292:1),Uncategorized] XamlIntrinsicTranslator.IsCharacterKey() : Back IS NOT a character key
[09/07 11:46:48,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function Start -------
[09/07 11:46:48,IEXPLORE.EXE(8292:1),Recording] WebRecordingSurfaceManager.PreRecordDescriptors() : Transitioning to ReadyToEdit state
[09/07 11:46:48,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for RadWatermarkTextBox TargetKey1
[09/07 11:46:48,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : AutomationId=PART_DateTimeInput,XamlTag=radwatermarktextbox
[09/07 11:46:49,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyDown() : Keydown received from Silverlight app
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Uncategorized] XamlIntrinsicTranslator.IsCharacterKey() : D4 IS a character key
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : IERecordingSurface KeyPress '4'
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : Was not already recording text
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : Starting text recording
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : First character was text; adding to buffer
[09/07 11:46:52,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyUp() : Keyup received from Silverlight app
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] IERecordingSurface.FinishSilverlightSetTextRecording() : Flushing Silverlight text recording buffer
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Uncategorized] IERecordingSurface.FinishSilverlightSetTextRecording() : focused element is not null
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] IERecordingSurface.FinishSilverlightSetTextRecording() : Firing SetText event
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function Start -------
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] WebRecordingSurfaceManager.PreRecordDescriptors() : Transitioning to ReadyToEdit state
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for RadWatermarkTextBox target
[09/07 11:46:52,IEXPLORE.EXE(8292:52),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : AutomationId=PART_DateTimeInput,XamlTag=radwatermarktextbox
[09/07 11:46:53,IEXPLORE.EXE(8292:52),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyUp() : Keyup received from Silverlight app
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function Start -------
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] WebRecordingSurfaceManager.PreRecordDescriptors() : Transitioning to ReadyToEdit state
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for RadBusyIndicator TargetKey1
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : XamlPath=
[09/07 11:46:56,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyDown() : Keydown received from Silverlight app
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Uncategorized] XamlIntrinsicTranslator.IsCharacterKey() : Return IS NOT a character key
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function Start -------
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] WebRecordingSurfaceManager.PreRecordDescriptors() : Transitioning to ReadyToEdit state
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Creating new Silverlight ElementDescriptor for TextBox TargetKey1
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] ElementsGenerator.CreateSLElementDescriptor() : Generated Sl FindExpr : XamlTag=gridviewcell,automationid=Cell_-1_6,|,XamlPath=/grid[0]/contentpresenter[name=PART_ContentPresenter]/gridvieweditorpresenter[0]/grid[0]/contentpresenter[0]/textbox[0]
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] RecordingSurfaceManagerBase.RecordDescriptorsInProject() : ------- Function End -------
[09/07 11:47:01,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : IERecordingSurface KeyPress '
'
[09/07 11:47:03,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyPress() : Was not already recording text
[09/07 11:47:04,IEXPLORE.EXE(8292:1),Recording] IERecordingSurface.IERecordingSurface_KeyUp() : Keyup received from Silverlight app
[09/07 11:47:42,Telerik.TestStudio.exe(4764:1)] First trace message from process 4764: "C:\Program Files (x86)\Telerik\Test Studio\Bin\Telerik.TestStudio.exe"
[09/07 11:47:42,Telerik.TestStudio.exe(4764:1)] First trace message from foreground thread "Application start thread" (managed ID = 1, native ID = 9032).

Boyan Boev
Telerik team
 answered on 10 Sep 2013
2 answers
97 views
I want to create a user defined function and a function library for a test. So that i can associate the function library with the test and can call the functions.
Boyan Boev
Telerik team
 answered on 09 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?