Telerik Forums
Test Studio Forum
1 answer
105 views
Hello,

When performing playback on a recorded test, it sometimes fails due to errors like the one in the attached image. These errors occur in another Internet Explorer instance and contain a message. My question is: how can these messages be captured and added to the log file? I saw that there is an example for dialogs, but not for IE. Could you please provide such an example for me?

Thank you,
Corina
Boyan Boev
Telerik team
 answered on 23 Sep 2013
5 answers
195 views
In trying to simulate a JavaScript alert dialog earlier, I ran into an issue with recording a "Tab" press from an input box.

Here is the scenario:

1) Type date into input1
2) Tab to next field
    a) if input1 date is older than 6 months old, javascript alert notifying user (scenario I am testing, and going to take a screenshot of in the test).
    b) if input1 date is within range, no javascript alert

When I played back the test, which had a "Handle 'Alert' Dialog", to my surprise, the test was hanging as that Alert never came up.

After some fiddling, I converted the step to code which is below:

[CodedStep(@"Keyboard (KeyPress) - Tab (1 times) on 'NewCensusEffectiveDateTextBox'")]
public void NavToPatient_CodedStep()
{
    ActiveBrowser.ContentWindow.SetFocus();
    Pages.AdminCensus.NewCensusEffectiveDateTextBox.ScrollToVisible();
    Pages.AdminCensus.NewCensusEffectiveDateTextBox.Focus();
    ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Tab"), 100, 1);
    ActiveBrowser.WaitUntilReady();
}

This is all being tested against a third party product, which I have no control over the javascript functions that result from the input box.  The input is below:

<input type=text size=10 maxlength=10 name=effective_date value="1/1/2001" onkeypress="return filterKeys(event)" onfocus='setDateItem(this, "P")' onblur="reformatDate(this)" onchange='reformatDate(this); javascript:ESOLValidateDateString(frmData.effective_date);checkUpdateCareLevel();'  >

As you can see it appears there is a lot going on here.

The issue comes with the "ActiveBrowser.ContentWindow.SetFocus();" line.  If I remove this line, the Alert will show up like normal.

What I think is occuring is, the "ActiveBrowser.ContentWindow.SetFocus();" line is not allowing the "onchange='reformatDate(this);" to run.

My question is, is the "ActiveBrowser.ContentWindow.SetFocus();" necessary as part of the default "Tab" record key action?

P.S. I know I can take care of all JavaScript Alert dialogs by using the following:

public override void OnBeforeTestStarted()
{
    Manager.DialogMonitor.AddDialog(new AlertDialog(ActiveBrowser, DialogButton.OK));
    Manager.DialogMonitor.Start();
}

..and I plan on it.  But I also want to work in taking a screenshot of the JavaScript alert and I haven't got into custom dialog handlers yet.
Daniel
Top achievements
Rank 2
 answered on 19 Sep 2013
54 answers
300 views
Is there any documentation on how to analyze the load and performance testing results from the load and performance testing.

Thanks,
Nithin
Cody
Telerik team
 answered on 17 Sep 2013
4 answers
103 views
I'm on version 2013, in Test Studio 2012 we can send mail automatically when test list execute all the test case. But I can't find this feature in 2013, please help
Velin Koychev
Telerik team
 answered on 17 Sep 2013
1 answer
126 views
How to check whether the focus is present on a particular element or not.

For e.g say i have two UI Elements and on first element i have configured onChange behavior.And once onChange is fired , focus should go to second element. So how to check whether focus is present on second element or not.
Boyan Boev
Telerik team
 answered on 17 Sep 2013
4 answers
47 views
Hi,

we had a Go to meeting today with a support specialist for the test list issue, where it was not running if the list had more than 4 test cases. Our project size is 700 MB ( with different modules with in the same project ). and will  grow more as we complete more module automations. 

Support specialist looked into the issue and suggested few options.

1. Upgrade the RAM size from existing 4 GB to 8 GB  
- Wanted to ensure before we invest on this , that the test list will indeed work with this configuration. Is this tested and is this the minimum requirement to run the test list when the project size is more ?

2. Split the Project into smaller ones , 1 project per module.

      - Is this possible , where we have integration scenarios / regression scenarios where we refer the process/elements accros different modules ? 

Pls help , as we are in tough situation , where we have 500 scripts automated and we cannot afford to have QAs to run individual tests for weeks, and we are anticipating that we are going to have another 1000 scripts automated. 
   

Boyan Boev
Telerik team
 answered on 17 Sep 2013
1 answer
78 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
110 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
120 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
228 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
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?