Telerik Forums
Testing Framework Forum
2 answers
133 views
Hi.

I have an test method:
[TestMethod]
[DataSource("")]
public void TestMeth()
{
try
{
//do something
}
catch(Exception ex)
{
Assert.Fail(ex.ToString());
}
}

The problem is: How I can to run this test again (max 3 times) when I get the exception? 

Is in telerik testing framework something to restart the test?





Andrei
Top achievements
Rank 2
 answered on 26 Apr 2012
2 answers
129 views
Hi

Where can i find release notes for the latest telerik test framework release??

When i go to the download page and click release notes a page with one line of text appears stating something along the lines of "R1 2012"
Konstantin Petkov
Telerik team
 answered on 18 Apr 2012
4 answers
149 views
Hi,

I have just installed the latest version of Test Studio Express (2012.1.411.0) and Safari (5.1.5). When we try to run a test via Qucik Execute Safari will launch and run through the test as expected. But when we generate the code and try to run the test via NUnit we get the following exception:

System.IO.FileNotFoundException : Safari executable path not found in registry
at ArtOfTest.WebAii.BrowserSpecialized.Safari.SafariActions.LaunchNewBrowserInstanceInt(Int32 timeout, String remotedUrl, ProcessWindowStyle windowStyle, Manager manager)
at ArtOfTest.WebAii.BrowserSpecialized.Safari.SafariActions.LaunchNewBrowserInstance(Int32 timeout, String remotedUrl, ProcessWindowStyle windowStyle, Manager manager)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)
at Cecil.SharePoint.Foundation.UITests.CanCreateCourseForStaffUnitTest.CanCreateCourseForStaff(BrowserType browser) in CanCreateCourseForStaffUnitTest.cs: line 78 

I've had a look through the forum, but I can't find anything on this. Do you know what registry key we need to set?


Craig
Anthony
Telerik team
 answered on 17 Apr 2012
8 answers
420 views
Hi Telerik team,

The scneario is like this : 
- In the main window of the application I am opening a pop window 
- Clicking on link button in pop up window 
- The pop up window gives an alert dialog with OK button
- Clicking on OK buttton in the Alert dialog which closes the Alert dialog 

Expected result: Alert dialog will be closed.
Actually result: Alert dialog is not handled.

Following is my code implementation. Please help to clarify.
sorry, I cannot find a public site to demo this scenario.
You can replace the URL with your local html.

Settings settings = new Settings();
settings.Web.DefaultBrowser = ArtOfTest.WebAii.Core.BrowserType.FireFox;
settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
Manager manager = new Manager(settings);
manager.Start();
 
manager.LaunchNewBrowser();
manager.DialogMonitor.Start();
 
// Setup dialog monitoring.
AlertDialog alertDialog = AlertDialog.CreateAlertDialog(manager.ActiveBrowser, DialogButton.OK);
manager.DialogMonitor.AddDialog(alertDialog);
 
// Set new browser tracking to enabled.
// This will make all new browser instances connect to the Manager.
manager.SetNewBrowserTracking(true);
 
manager.ActiveBrowser.NavigateTo("http://localhost:60444/ConduitGenericWebSite/Default.aspx");
 
Element confButton = manager.ActiveBrowser.Find.ById("lnkShowPopup");
(new HtmlControl(confButton)).Click();
 
// Wait for the new browser instance to connect.
manager.WaitForNewBrowserConnect("http://localhost:60444/ConduitGenericWebSite/ChildPage.aspx", true, 10000);
 
// disable new browser tracking
manager.SetNewBrowserTracking(false);
 
// Click to invoke AlertDialog.
Element confButton1 = manager.ActiveBrowser.Find.ById("lnkShowConfirmAndAlert");
(new HtmlControl(confButton1)).Click(true);
 
alertDialog.WaitUntilHandled(3000);

Regards,
Jeffery
Jeffery
Top achievements
Rank 1
 answered on 17 Apr 2012
9 answers
110 views
Hello,

I have a component that attaches to the onblur handler of a textbox.  The issue with this is that it doesn't want to attach; I have a math calculator component (an AJAX extender) that sums up the textbox values, and unfortunately its not doing the summation.  Do I have to setup something else for this?

Thanks.
Cody
Telerik team
 answered on 13 Apr 2012
1 answer
110 views
In some test cases I'm seeing RefreshDom failing (returning false).  This is seen with IE, other browsers haven't been tried.

Any pointers on what could cause this method to fail?
Plamen
Telerik team
 answered on 09 Apr 2012
1 answer
75 views
Hi.

I have a RadSlider control with minimum and maximum values.

How I can to change this values from UnitTest ?

part of code:

var severityHeaderComboBox = app.VisualTree.Find.ByName<RadComboBox>("HeaderComboBox");
Assert.IsNotNull(severityHeaderComboBox);
severityHeaderComboBox.User.Click();
RadSlider severitySlider = severityHeaderComboBox.Find.ByName<RadSlider>("severitySlider");
severitySlider.Refresh();

//try to change min value
severitySlider.DragToTick(ThumbName.StartThumb, 2);


Error message:
Assert.Fail failed. ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
Stoich
Telerik team
 answered on 06 Apr 2012
3 answers
113 views
Hi

Is it possible to see how long a timeout took before it failed?

Currently when a telerik method fail on timeout the only info i get is "Wait condition timeout" or something along those lines, i would really like to have outputted how long the timeout took.

E.g.
Wait condition timeout after XX seconds


is that possible??

If it's not could you add it as a request for improvement :)
Cody
Telerik team
 answered on 05 Apr 2012
1 answer
70 views
Hi team,
i met an issue about cookie today. In my web application, there is a debug page("http://wwwqa.inventory.ford.com/debug/cookies.jsp") to add a cookie with name "dealerPooling" and value "true", if i add this cookie, then a proper page will display.
My version of  telerik test studio is 2011.2.1413.0

scenario 1:
     step1: turn to "http://wwwqa.showroom.ford.com/FDShowroom.jsp?makeTransition=inventory"
     step2: click on FIESTA image
     step3: input a zipcode(48033) to zipcode input textbox and click "SEARCH DEALER INVENTORY" button
     step4: A search dealer inventory page for this scenario1 will display

scenario 2:
     turn to a debug page "http://wwwqa.inventory.ford.com/debug/cookies.jsp" and add a cookie with name "dealerPooling" and value "true"
     repeat steps in scenario2, and we can see a different search dealer inventory page for this scenario2.

What i want to know is how to add cookie with code steps?
I have tried several ways to do that, but failed, only scenario1 page displayed when i execute scenario2 step, here is some code to be invoked before clicking "SEARCH DEALER INVENTORY"

1.
Public Sub SetCookie()
            Dim newCookie As New System.Net.Cookie()
            newCookie.Name = "dealerPooling"
            newCookie.Value = "true"
            newCookie.Domain = "http://wwwqa.inventory.ford.com"
            newCookie.Expires = DateTime.MaxValue
            ActiveBrowser.Cookies.SetCookie(newCookie)

End Sub

2.
Public Sub SetCookieWithDebugPage()
            ActiveBrowser.NavigateTo("http://wwwqa.inventory.ford.com/debug/cookies.jsp")
            
            Dim nameBox, valueBox As HtmlInputText
            Dim submitButton As HtmlInputSubmit
            
            nameBox = Find.ByAttributes(of HtmlInputText)("name=newName")
            valueBox = Find.ByAttributes(of HtmlInputText)("name=newValue")
            nameBox.Text = "dealerPooling"
            valueBox.Text = "true"
            submitButton = Find.ByAttributes(of HtmlInputSubmit)("name=addCookie")
            submitButton.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
            submitButton.Click
End Sub
Anthony
Telerik team
 answered on 03 Apr 2012
4 answers
138 views
Hello,

I have a couple of issues I'm currently wresting with. 

To start, I'm writing "code only" tests - I only have access to the API, not the full Test Studio. So please, code-only responses.

I have a Silverlight application. It consists of many individual pages with Silverlight (and custom and 3rd party) controls on them. I'm writing a "smoke test" that just iterates through the pages of the application (each URI is kept in the database. In my test I open a connection to the database, read the URI column from the Menu table, construct the full path to the resource and use ActiveBrowser.navigateTo(URI) to go to that page) - the issue is twofold: 

If a page has an exception on it (which is what I'm testing for - pages that throw exceptions when you attempt to load them) it will bring up a dialog box with the exception info on it. How do I capture that dialog and retrieve information from it? It's hard to explain the exact nature of this dialog box - it's not a custom dialog box that we wrote, it's just the 'generic' Silverlight "Error Occured" dialog box which has the exception and a 'drop down button' which, when clicked, opens up a text area with the full exception description on it. Another way of looking at it is: I want to trap (or list or write to Console) every page that throws this type of dialog so I know when pages fail to load (or throw an exception) in my app. Like I said, this is a "smoke test" that simply loads each page in our application and makes sure there are no exceptions encountered. When I do encounter an exception, how do I "mark" it as such or extract information from it?

The second part of the question also has to do with dialog boxes - this time, we have certain pages that, when you navigate to them, the first thing they do is bring up a modal dialog box (actually it's just a control, not of type Modal Dialog box or anything) - basically it can be thought of as just a Modal Silverlight window that is brought up upon page load - I know which pages do this (they all have a certain string present in their URI which I can code for in the test and have already done so) and can attach an event handler or something upon encountering one... but the code I copped from your web site doesn't quite work for me: 

public void DoCustomDialogHandlingForBuiltInDialogs()
 {
    AlertDialog myAlertDialog = new AlertDialog(ActiveBrowser, DialogButton.OK);
    myAlertDialog.HandlerDelegate = new DialogHandlerDelegate(MyCustomAlertHandler);
   
    // Add dialog to monitor and start monitoring
    Manager.DialogMonitor.AddDialog(myAlertDialog);
    Manager.DialogMonitor.Start();
   
    Actions.InvokeScript("InvokeAlert()");
   
 }
   
///<summary>
/// Custom dialog handler delegate
///</summary>
///<param name="dialog">The dialog to handle</param>
///<returns></returns>
public bool MyCustomAlertHandler(IDialog dialog)
{
    // Simply close the dialog
    dialog.Window.Close();
   
    try
    {
         // Wait until it is closed
         dialog.Window.WaitForVisibility(false, 50);
         Log.WriteLine("Alert Handled!");
         return true;
    }
    catch
    {
         Log.WriteLine("Failed to handle alert!");
         // return false if the dialog did not close as expected
         return false;
    }
}

I have connived this into my code but not sure what I've done is correct - I also had to change the return type of the Delegate to be "void" as the compiler complained that the method had the wrong return type. I just commented out the return statements.

Any help is appreciated as always. 

Thanks,

Jess

Jess
Top achievements
Rank 1
 answered on 03 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?