Telerik Forums
Testing Framework Forum
1 answer
104 views
Hi,
I am trying to check a condition on the failed webpage using Htmlspan label text. The application requires moving from one webpage to another webpage and perform certain actions on the webpage and the loop continues for several webpages. When i record the failed webpage i get the below lines of code which i am trying to use this in my if else condition. The issue which i am facing is that it works for the first error webpage and moves to the second webpage. When the second webpage fails i am getting an error. The condition is not able to get the failed template HtmlSpan label text and moving to the else condition. (FYI. All the failed webpages pick the text content from the same HtmlSpan i.e same error page loads everytime when ever a page fails). 
It would be very helpful if you could suggest me a proper approach to achieve this.

Regards,
Santosh
 



Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, "Sorry there was an error displaying your report."); 
                       or 
Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.BaseElement.Wait.ForCondition((a_0, a_1) => ArtOfTest.Common.CompareUtils.StringCompare(a_0.TextContent, "Sorry there was an error displaying your report.", ArtOfTest.Common.StringCompareType.Contains), false, null, 10000); 
    
if (Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.IsEnabled) 
                     or 
if (Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.IsVisible()) 
Code to move to next webpage
Pages.Online4.ImgRightArrow.Click(false);
  
else
Some Code to perform actions on the rendered webpage
    
}
Anthony
Telerik team
 answered on 11 May 2012
4 answers
460 views
Hi everyone,

As you know, we can get the attribute value by the index, but there is a way to get the attribute by the "attribute name" instead of the Index? Because the index is not the same in the different browsers.

I've tried it, but nothing :(

Could someone please help me to see if this is possible?
Thanks,
Juan 
Juan
Top achievements
Rank 1
 answered on 11 May 2012
2 answers
64 views
Hi.

I have included support for unsupported in this FF version Telerik extension in the FF 8.1 (about:config changes) and tried to execute my tests.
All was OK, but unfortunately different exceptions appears during attempt to hovering over successfully found elements.
Tell me please:
1) Are FF 7, 8 will be supported by TF?
2) May be exists some methods which will help to resolve this issue with hovering?

Thanks,
Anton.
Anton
Top achievements
Rank 1
 answered on 10 May 2012
1 answer
103 views
{
(...) # get data from sql
Random r = new Random(); int val = r.Next(0, t.Rows.Count - 1); var row = t.Rows[val]; GridViewRow ro = Pages.App.SilverlightApp.Get<GridViewRow>("TextContent=" + row[0].ToString(), "XamlTag=textblock"); Debug.WriteLine("Index: " + ro.Index.ToString());
ro.User.Click(MouseClickType.LeftDoubleClick);
} Can someone tell me how can I get the Index, RowIndex of this (ro) row. From
Debug.WriteLine("Index: " + ro.Index.ToString());
I get always "0".
Anthony
Telerik team
 answered on 09 May 2012
1 answer
113 views
Hi,


I am new to telerik and trying to learn Automation Framework.  Recently i tried customizing code for my AUT through C# in Telerik Test Studio.

To my surpsrise the statement :" SilverlightApp app = ActiveBrowser.SilverlightApps()[0];" in my code threw Exception given below :-

"

Failure Information: ~~~~~~~~~~~~~~~Exception thrown executing coded step: '[writing_CodedStep] : Navigate to : 'http://pxsnydmsapp001v.dts.dadcdigital.com/''.InnerException:System.ArgumentException: Index '0' is invalid. List contains only '0' apps at ArtOfTest.WebAii.Silverlight.SilverlightAppsList.get_Item(Int32 index)

"

I am unable to understand the cause of this : My AUT first shows login page where i am successfully able to dynamically identify UI Elements and input the value. After Login AUT opens silverlight Application page. Its there where i am unable to identify App itself.

Here is my code :

using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;

namespace Project_Saurabh
{

    //
    // You can add custom execution steps by simply
    // adding a void function and decorating it with the [CodedStep]
    // attribute to the test method.
    // Those steps will automatically show up in the test steps on save.
    //
    // The BaseWebAiiTest exposes all key objects that you can use
    // to access the current testcase context. [i.e. ActiveBrowser, Find ..etc]
    //
    // Data driven tests can use the Data[columnIndex] or Data["columnName"]
    // to access data for a specific data iteration.
    //
    // Example:
    //
    // [CodedStep("MyCustom Step Description")]
    // public void MyCustomStep()
    // {
    //        // Custom code goes here
    //      ActiveBrowser.NavigateTo("http://www.google.com");
    //
    //        // Or
    //        ActiveBrowser.NavigateTo(Data["url"]);
    // }
    //
       

    public class writing : BaseWebAiiTest
    {
       
       
       
        #region [ Dynamic Pages Reference ]

        private Pages _pages;

        /// <summary>
        /// Gets the Pages object that has references
        /// to all the elements, frames or regions
        /// in this project.
        /// </summary>
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }

        #endregion
       
        // Add your test methods here...
   
        [CodedStep(@"Navigate to : "AUT")]
        public void writing_CodedStep()
        {
            // Navigate to : '"AUT"'
            string landingpage;
            // Create my own Settings object and then modify the defaults
            Settings mySettings = new Settings();
            mySettings.EnableSilverlight = true;
                        
            mySettings.DefaultBrowser = BrowserType.InternetExplorer;
            mySettings.ClientReadyTimeout = 60000;
              Manager.LaunchNewBrowser();
           
            // Use my Settings object to construct my Manager object
            Manager myManager = new Manager(mySettings);
            System.Threading.Thread.Sleep(5000);
            myManager.Start();
            myManager.LaunchNewBrowser();
           
            myManager.ActiveBrowser.NavigateTo("AUT");
                                                      
            Element mybtn = myManager.ActiveBrowser.Find.ByName("Login1$UserName");
            System.Threading.Thread.Sleep(2000);
            myManager.ActiveBrowser.Actions.SetText(mybtn,"username");
            System.Threading.Thread.Sleep(2000);
            Element mybtn1 = myManager.ActiveBrowser.Find.ByName("Login1$Password");
            System.Threading.Thread.Sleep(2000);
            myManager.ActiveBrowser.Actions.SetText(mybtn1,"password");
            System.Threading.Thread.Sleep(2000);
           
            Element mybtn2 = myManager.ActiveBrowser.Find.ByName("Login1$LoginButton");
            System.Threading.Thread.Sleep(2000);
            myManager.ActiveBrowser.Actions.Click(mybtn2);
            System.Threading.Thread.Sleep(2000);
           
            System.Threading.Thread.Sleep(60000);
           
          
            ActiveBrowser.RefreshDomTree();
           
            SilverlightApp app = ActiveBrowser.SilverlightApps()[0];    // THE LINE WHICH THROWS ERROR/EXCEPTION
            
           
        }
    
                   }
}




Anthony
Telerik team
 answered on 07 May 2012
4 answers
151 views
Hello,

we are using the latest version of your testing framework, and are unable to set cookies when using Chrome (other browsers don't exhibit this problem)

string path = "/some/path/";
string root = "localhost:900";
 
var cookie = new Cookie(
                CookieName,
                CookieValue,
                path,
                root)
                {
                    Expires = DateTime.UtcNow.AddDays(CookieExpireInDays)
                };
 
TelerikProxy.ActiveBrowser.Cookies.SetCookie(cookie);
var userCookieAfterLogin = TelerikProxy.ActiveBrowser.Cookies.GetCookies("http://" + root + path);
CollectionAssert.IsNotEmpty(userCookieAfterLogin);

The last assertion always fails. The example you mention here does not exhibit this behavior. When I omit the port, and only use
string root = "localhost";
the problem still persists, however setting the root to loopback
string root = "127.0.0.1";
seems to work, as long as the port is omitted.

We would really appreciate if this issue could be fixed, as this is a major impediment that stops us from purchasing your Test Studio.

Thank you.

Regards,
Peter
Plamen
Telerik team
 answered on 04 May 2012
2 answers
119 views
Hi,

I need to select some items from RadTreeListView from test.

But I see that TreeListView tests from TelerikTestingFramework don't work.

For example the test: TreeListViewStructureTest  done error on line 
"Assert.AreEqual<int>(5, treeListView.Columns.Count, "Initial tree list view column count verification failed!");"

that "Element not found", same problem when I try to get TreeListItems.

Is there other solutions to get TreeListItem and select it?
Andrei
Top achievements
Rank 2
 answered on 03 May 2012
3 answers
167 views
Hi

Is there a nice way to trigger CSS OnHover?, without actually using the methods which move the mouse.

Thinking of something along the lines of .InvokeEvent(ScriptType.MouseOver)
Cody
Telerik team
 answered on 01 May 2012
1 answer
54 views
I'm trying to verify images in a web app, and I notice that HtmlImage.Capture does a screen grab. If the image, once I scroll it into view, is partially obsured by a floating header we have, then the Capture() call will return part of that header.

Is there a better way to grab the image? Also, we'd like to run this on a build server too, where there is not necessarily an interactive user.

Do I need to download the image directly using the value in the SRC tag?


Anthony
Telerik team
 answered on 30 Apr 2012
3 answers
73 views

Manager.SetNewBrowserTracking(
true);
Find.ById<HtmlAnchor>("OfferDescription_code").MouseClick();
Manager.WaitForNewBrowserConnect(AD_SITE, true, 9999);
Manager.ActiveBrowser.WaitUntilReady();
Assert.IsTrue(Manager.Browsers.Count == 2);


This Assert always fails because the original window is ALWAYS closed after the popup launches on the MouseClick() call.

I've tried in both IE and Firefox.  Any ideas?
Plamen
Telerik team
 answered on 27 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?