Telerik Forums
Testing Framework Forum
1 answer
88 views
To avoid issues with any plugins like RoboForm or others that might cause problems, and to ensure you have a clean slate when doing UI testing, it would be worth considering doing what Selenium does when it spawns Firefox. It uses the -profile command line option to spawn the Firefox used for testing with a completely fresh profile (and you can force a specific one if you wish with a config option). That way you know it won't get messed up by any other features or plugins. It would be really good if the Telerik tools could do the same thing:

firefox.exe -profile "E:\myprofile"

I also believe if you do this, it will spawn a brand new Firefox instance, so it won't interfere with an existing one that you might have running at the same time.

Not sure if this is at all possible with IE, but if it is possible with IE that would be a welcome addition there as well.
Mario
Telerik team
 answered on 30 May 2013
1 answer
117 views
Is there someway using telerik that I can take a screenshot of what is behind my form? Currently attempting this with regular wincontrols creates flicker that I don't want, and I was wondering if there was a control, property, or method that can achieve this for me?

Thanks!

Edit I forgot to mention that I am using winforms c#
Boyan Boev
Telerik team
 answered on 27 May 2013
1 answer
131 views
Hello,

I am trying to following the tutorial in the documentation: http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/html/dynamic-grid.aspx

1. I first navigate to the site http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
2. Then I add GridTableView to project element
3. I added a code step with the code:

foreach (HtmlTableRow r in Pages.ClientSideRowSelection.TemporaryRadGridTable1)
            {
                foreach(HtmlTableCell c in r.Cells)
                {
                    Log.WriteLine("Cell found. TextContent:"+c.TextContent);
                }
            }

Then when I run the test, I get an error in the log saying: "......DynamicGridTest.tstest.cs: Line 78: (CS1579) foreach statement cannot operate on variables of type 'Telerik.WebAii.Controls.Html.GridTableView' because 'Telerik.WebAii.Controls.Html.GridTableView' does not contain a public definition for 'GetEnumerator'"

How do I solve this problem?

Thanks



-------------------------------------

never mind, solved.
Mario
Telerik team
 answered on 24 May 2013
9 answers
604 views
Hi,

I´ve got a big problem by getting the inner text of an element. I spent a whole day in trying and letting this in theory simple thing drive me crazy..

<span id="messageText">That´s the text i want to get...</span>

I want to assert this text but always get an empty string. This is my current code:
var frame = browser.WaitForElement(new HtmlFindExpression("id=rightIFrame"), 10000, false);
var span = frame.Find.ByExpression<HtmlSpan>(
"id=rightIFrame");
span.Wait.ForExists();
Assert.AreEqual(
"That´s the text i want to get...", span.TextContent);

Result:
Expected string length x but was 0. Strings differ at index 0.
  Expected: "That´s the text i want to get.."
  But was:  <string.Empty>
  -----------^

I also tried InnerText but it doesn´t change anything, now I just don´t know what to do and hope you can help me.

(Edit: I also already tried Thread.Sleep(), even though it surely hadn´t been a clean and good solution, just to see if the text maybe hasn´t loaded yet, but not even that did change anything..)

Thanks
Kind regards

Boyan Boev
Telerik team
 answered on 21 May 2013
3 answers
99 views
Hello,

I would like to capture events through the Teleric testing framework. I want my application to be notified whenever a user clicks on a button, changes text in a control, etc on a webpage with a Silverlight control.  When the framework notifies my application, I want my application to capture the control properties. Can you help me with some sample code which does that ? 

Thanks
Plamen
Telerik team
 answered on 20 May 2013
1 answer
99 views
the responsehandler is called with the first row in the spreadsheet but with subsequent rows the responsehandler is not called.

 Settings testSettings = new Settings();  
            testSettings.Web.UseHttpProxy = true;       
            Manager mgr = new Manager(testSettings);
            try
            {             
                mgr.Start();               
                ResponseListenerInfo li = new ResponseListenerInfo(ResponseHandler);
                Debug.WriteLine("instantiated listener");
                mgr.Http.AddBeforeResponseListener(li);
                Debug.WriteLine("added listener");
                mgr.LaunchNewBrowser(BrowserType.InternetExplorer, true);
                url = string.Format("http://{0}{1}", domain, Data["url"]);
                mgr.ActiveBrowser.NavigateTo(url);
                
                mgr.ActiveBrowser.WaitUntilReady();
                mgr.Http.RemoveBeforeResponseListener(li);
                // System.Threading.Thread.Sleep(3000);
                mgr.ActiveBrowser.Close();
                // li=null;               
            }
            catch(Exception e){
                Debug.WriteLine(string.Format("error {0}",e.Message));   
            }
            finally
            {                   
               mgr=null;
               Debug.WriteLine("finally");
                System.Threading.Thread.Sleep(5000);
            }
        }
        
        private void ResponseHandler(object sender, HttpResponseEventArgs e)
        {            
            Debug.WriteLine(string.Format("{0} - {1}", e.Response.Request.RequestUri,e.Response.StatusCode));
            int[] codes=new int[]{301,302,303,304,305,306,307};
            if (codes.Contains<int>(e.Response.StatusCode)){
               
               Assert.IsTrue(false);
                
            }
            System.Collections.Specialized.NameValueCollection headers = e.Response.Headers;
            if (url == e.Response.Request.RequestUri )
            {
            
                //some are reported as soft but they are real pages.
                if (e.Response.StatusCode != 200)
                {                 
                    Assert.IsTrue(ArtOfTest.Common.CompareUtils.StringCompare(e.Response.StatusCode.ToString(), "404",
                                                                              FindCompareType.Exact));
                }
            }
        }
Plamen
Telerik team
 answered on 18 May 2013
7 answers
172 views
Hi there,

I'm new to WebAii, but I was able to get some level of Silverlight automation up and running. Now, however, it appears I've hit an obstacle.

I've attached a picture of the subset of elements I'm working with. I can get a reference to the DashboardPanel element shown at the top of the image, and I can traverse the children up to the Canvas element. When debugging in Visual Studio, however, Canvas shows as having no children whatsoever. I've tried several different tactics for getting the element, but I'm confident none will work as long as Canvas supposedly has no children. Code below. Thoughts?

// Initialize the settings
Settings mySettings = new Settings();
Manager mgr = null;
SilverlightApp app = null;
 
try
{
    mySettings.Web.EnableSilverlight = true;
    mySettings.Web.DefaultBrowser = BrowserType.Chrome;
     
    // Create the manager object
    mgr = new Manager(mySettings);
 
    // Start the manager
    mgr.Start();
 
    // Launch a browser instance and navigate to the page
    mgr.LaunchNewBrowser();
    mgr.ActiveBrowser.NavigateTo("http://<;url>/");
 
    // Initialize the Silverlight app
    app = mgr.ActiveBrowser.SilverlightApps()[0];
 
    // Log into Jovix
    app.Find.WaitOnElementsTimeout = 20000;
    app.FindName<TextBox>("txtUsername").Text = "<username>";
    app.FindName<PasswordBox>("txtPassword").SetPassword(true, "<password>", 0, 0);
    app.FindName<Button>("btnLogin").User.Click();
 
    // Get the navigation tree control
    TreeView navTree = app.FindName<TreeView>("TreeView");
 
    // Navigate to Custom Fields tree view item
    navTree.Find.WaitOnElementsTimeout = 20000;
    navTree.Find.ByTextContent("Materials").Parent<TreeViewItem>()
        .Find.ByType<ItemsPresenter>()
        .Find.ByName<ToggleButton>("ExpanderButton").User.Click();
 
    navTree.Find.ByTextContent("Custom Fields").User.Click();
 
    // Try to click Add button on the toolbar
    FrameworkElement dpMain = app.Find.ByExpression(
        new XamlFindExpression("Name=dpMain")); // this works
 
    FrameworkElement dragDockPanelHost = dpMain.Find.ByExpression(
        new XamlFindExpression("XamlTag=DragDockPanelHost")); // this works
 
    FrameworkElement widget = dragDockPanelHost.Find.ByExpression(
        new XamlFindExpression("XamlTag=WidgetBase")); // this returns null

Thanks in advance!
Geoffrey
Cody
Telerik team
 answered on 17 May 2013
5 answers
186 views
I've been trying to install the testing framework repeatedly and it always hangs at "Updating Visual Studio 2012 Templates" and will just sit there for hours with no error or change of status.

Anyone experience anything like this?  I'm on Windows 8 64bit. 
Rodney
Telerik team
 answered on 15 May 2013
3 answers
187 views
Hi,
  I've got a problem running the latest version of telerik test framework and chrome. I'm trying to get the text in a popup dialog in a javascript app. I've confirmed that when running the app in the following link (with slight modifications) it doesn't work.

http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/confirm-and-alert-dialogs-issue-in-firefox.aspx

Modification:

            ConfirmDialog confirmDialog = ConfirmDialog.CreateConfirmDialog(ActiveBrowser, DialogButton.OK);
            confirmDialog.HandlerDelegate = new DialogHandlerDelegate(dialog =>
                                                                          {
                                                                              var captionWorks = dialog.Window.Caption;
                                                                              var THIS_RETURNS_ZERO = dialog.Window.AllChildren.Count;
                                                                          });
            Manager.DialogMonitor.AddDialog(confirmDialog);
            Manager.DialogMonitor.Start();


Can you confirm and advise on a workaround/when a fix might be expected?
  Thanks,
    John
Boyan Boev
Telerik team
 answered on 13 May 2013
19 answers
462 views
Hi,

Im trying to assert that a link (you must klick on a image) works. The link opens a new tab and I thought the best assertion for this link is just finding smth in this new window(browser) and close it after..
After openeing the link in a new tab or window im getting following exception:

System.OperationCanceledException : Exception occured waiting for the new browser to connect.
  ----> System.TimeoutException : Wait for condition has timed out
with following code

/// <summary>
/// Tests if clicking the Jira-image opens Jira
/// </summary>
[Test]
public void JiraImgOpensJira()
{      
    Manager.SetNewBrowserTracking(true);
    frame.Find.ById<HtmlImage>("Jira").MouseClick();
 
    Manager.WaitForNewBrowserConnect("https://someLink.de", true, 2000); //EXCEPTION IS AT THIS LINE
    Manager.SetNewBrowserTracking(false);                     
 
    //Assert Jira opened                
    Assert.IsTrue(ActiveBrowser.ContainsText("JiraLogin"));
    ActiveBrowser.Close();          
 
}

first i thought the problem might be the "https" but this code also doesnt work:
(TimeoutException)

[Test]
public void SampleWebAiiTest()
{
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
    ActiveBrowser.NavigateTo("http://vvs.de/");
    Find.ById<HtmlDiv>("twitterFCE").MouseClick();
    Manager.SetNewBrowserTracking(true);
    Manager.WaitForNewBrowserConnect("http://twitter.com/VVS#", true, 6000);
    Manager.SetNewBrowserTracking(false);
}

I searched the whole web but everyone is doing the same like in my code.

There are 2 other questions I have:
1. I must interact with at least 1 object/element within my browser that it can detect an iframe --> why?
2. Is Telerik testing Framework compatible to FF 15.0? I am not able to initialize any tests
Plamen
Telerik team
 answered on 13 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?