Telerik Forums
Testing Framework Forum
5 answers
133 views

I trying to automate the Silverlight UI, It contains the tab structure the change tile textbox is in bydefault selected Tab ,  I am  trying to access it (see the last line in test code which is Bold throws Exception.) but it throwing some exception the eeor messgae is as below

Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition.
Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)


My Xaml file code snippet is like below

 

<TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource TitleTextBlockStyle}"><Run Text="Change Title"/></TextBlock>

<TextBox x:Name="txt_Essentials_ChangeTitle" Grid.Row="0" Grid.Column="2" Margin="2">

 

</TextBox>

 

 

Below is my Test Code:

 

Settings mySettings = new Settings(BrowserType.InternetExplorer, @"D:\log\");

 

 

 

Manager myManager = new Manager(mySettings);

 

 

myManager.Start();

myManager.LaunchNewBrowser();

myManager.ActiveBrowser.NavigateTo("

http://ApplicationURL");

 

 

myManager.ActiveBrowser.WaitUntilReady();

 

SilverlightAppsList slvrApp = myManager.ActiveBrowser.SilverlightApps();

 

 

 

SilverlightApp app = slvrApp.GetApp(0);

 

 

app.FindName<

TextBox>("txt_Essentials_ChangeTitle").Text = "ArtOfTest did the trick";


Please Suggest me the solution I am stucked up here ...........!

 

 

 

 

 

Cody
Telerik team
 answered on 28 Jun 2010
7 answers
216 views
Hi,
Below is my test script but its not identifying the childwindow

[TestMethod]  
        public void ChildWindowTest()  
        {  
            //  
            // TODO: Add test logic here  
            //  
            //Manager.Settings.ExecutionDelay = 10;  
 
            Manager.LaunchNewBrowser(BrowserType.InternetExplorer);  
            //System.Drawing.Point loc = ActiveBrowser.Window.Location;  
 
            ActiveBrowser.NavigateTo("http://localhost:1031/SampleSilverlightAppTestPage.aspx");  
            ActiveBrowser.WaitUntilReady();  
            SilverlightApp app = ActiveBrowser.SilverlightApps()[0];  
            Assert.IsNotNull(app);  
 
            Button btnShowConfirmDialogue = app.Find.ByName<Button>("btnShowConfirmDialogue");  
            Assert.IsNotNull(btnShowConfirmDialogue);  
            btnShowConfirmDialogue.User.Click();  
 
            Thread.Sleep(2000);  
            app.RefreshVisualTrees();  
            IList<ChildWindow> childWindows= app.Find.AllByType<ChildWindow>();  
            ChildWindow myChildWindow = app.Find.ByName<ChildWindow>("ConfirmDialogueWindow");  
 
            Button btnCancel = myChildWindow.Find.ByName<Button>("CancelButton");  
            btnCancel.User.Click();  
              
        } 


I have added Track method also in the Childwindow constructor

 

public partial class ConfirmDialogue : ChildWindow  
    {  
        public ConfirmDialogue()  
        {  
            Telerik.WebUI.PopupTracker.Track(this);  
            InitializeComponent();  
        }  
 
        private void OKButton_Click(object sender, RoutedEventArgs e)  
        {  
            this.DialogResult = true;  
            MessageBox.Show("Ok");  
        }  
 
        private void CancelButton_Click(object sender, RoutedEventArgs e)  
        {  
            this.DialogResult = false;  
            MessageBox.Show("Cancel");  
        }  
    } 

 

 

 

 

 

Below is the error i am getting
Test method WebAiiSample.WebAiiTest.ChildWindowTest threw exception:  System.ApplicationException: Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression, Boolean includeRoot)
   at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression)
   at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam).

Konstantin Petkov
Telerik team
 answered on 25 Jun 2010
1 answer
135 views

Hello Nelson,
thanks for replying all the tickets its very happy to glance u r response espcially the time out problem was solved.
iam sending one screen shot plez check it . The problem is when iam inserting any text in the textbox it is not recoginzed
upto the below sceenshot it is executing and giving the below exception

Unable to locate element. Details: Attempting to find [Silverlight] element using

Find logic

 (Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]

 (Silverlight): [XamlTag 'Exact' gridviewvirtualizingpanel] AND [automationid 'Exact' PART_GridViewVirtualizingPanel] THEN UNDER NODE FIND [XamlPath 'Exact' /gridviewrow[6]/grid[name=grid]/datacellspresenter[name=PART_DataCellsPresenter]/stackpanel[0]/horizontalscrollpanel[name=PART_PartialScrollContainer]/gridviewcellspanel[name=PART_GridViewCellsPanel]/gridviewcell[1]/grid[name=SelectionBackground]/alignmentcontentpresenter[name=PART_ContentPresenter]/grid[0]/hyperlinkbutton[0]]

                    
                                                       iam using telerik with vsts      

 

 

        2)How many types of recording we have in telerik

    3)I need some coustom code for c# language like whenever i need to write code i want to know what type of systax we can use
    3) plez tell to any user guide or any link so i can explore about telerik with vsts i want some real scenrio and demo, video.
    plez reply me as soon as possible

    thank you very much NELSON
    REGARDS
    Dileep.s


     

    Missing User
     answered on 24 Jun 2010
    2 answers
    115 views
    I'm trying to automate the inital logging in for our application tests which is a popup.

    I've tried registering the ChildWindow both in its contructor and after it's show method using the new Track() method in both the official and latest build.  When debugging the Silverlight application, I can verify that the popup count is one and that it is indeed being tracked.

    But in my test (nunit) it always shows the popup count as zero regardless of when I register it or if I call RefreshVisualTrees() in the test.  We are using Prism and SL4 so it might be Prism related, but in this case we are explicitly newing up the item rather than using Unity.

    Any suggestions?

    Much thanks!

    Edit - I should mention we are using the Telerik silverlight controls which has its own popup tracking method and calling that method rather than adding the popup DLL.  Is this the issue?  If I add the popup dll VS2010 complains that the same code is declared in both DLLs.
    Kiran
    Top achievements
    Rank 2
     answered on 24 Jun 2010
    10 answers
    210 views
    Hi again,

    I have a drop down list with an async postback to the server every time the ddl's value is set, but since the test continue to update other fields while there is a postback in progress, these fields lose their values when the postback is finished.
    At least this is what I think is happening.
    When I add a Thread.Sleep(1000) the test runs as expected.

    I've tried ActiveBrowser.WaitUntilReady(); but that does not help.
    Is there another way (than Thread.Sleep(1000)) to find out when the browser is ready to continue?
    Konstantin Petkov
    Telerik team
     answered on 24 Jun 2010
    1 answer
    98 views
    Hello,
    There should be a way to capture dynamic values within the tool.  can any Telerik user guide for capturing dynamic values
    can u tell how to explore more regarding telerik with vsts is any online material ,videos........ etc
    I need more KT in telerik iam fresh in using telerik plez help me out

    regards
    Dileep


    Missing User
     answered on 23 Jun 2010
    1 answer
    75 views
    Hello thanks in advance for yesterday response,

    Data grid object is static so not easy to select the values from grid what i have to do while selecting  the static data in grid view
    the time out exception is giving


    thanks in advance
    Dileep.s

    Missing User
     answered on 23 Jun 2010
    1 answer
    149 views

    Hello,
    iam getting this problem can any one help me out of this problem


    Unable to locate element. Details: Attempting to find [Silverlight] element using
    Find logic
     (Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]
     (Silverlight): [TextContent 'Exact' TB122] AND [XamlTag 'Exact' textblock]

    Unable to locate element. Search failed!

    --------------------------------------------------
    '6/22/2010 9:18:56 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
    --------------------------------------------------
    '6/22/2010 9:19:02 AM' - Overall Result: Fail
    --------------------------------------------------

    regards
    Dileep

    Missing User
     answered on 22 Jun 2010
    5 answers
    158 views

    Any ideas(via code) how to scroll when combobox has been clicked and result set is not entirely visible?

    Example.
    I have a combobox that has 30 items and only the first 10 show without scrolling. In my coded test I have a loop that clicks on the combo box and checks if the item exists via find.byText. When looping through, it looks for items that are visible and keeps moving, If it cant find the item it hits the catch via timeout and I get my predefined error. Problem is it cant find items in the combobox that show only when the combobox is scrolled down. ANy ideas?
    Code for example:

     

    foreach

     

     

    (PressImposition checkProd in Products)

     

     

    {

     

     

     

        try

        {

     

     

            //Select Product Dropdown

            Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.HoverOver();

            Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.Click();

     

     

            TextBlock select = Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.Find.ByText(checkProd.OfferingDisplayName);

            select.User.HoverOver();

            select.User.Click();

        }

     

     

        catch

        {

     

     

            Assert.Fail("Test Failed to Find Imposition Product");

        }

    }

     

     

     

     

    Cody
    Telerik team
     answered on 18 Jun 2010
    1 answer
    180 views
    The Browser has FindElementByXPath() method.
    But seems like for this to work one would need to give the Xpath from the root layer.

    Is there a way to query for child nodes using an xpath ? So that we can give an xpath relative to the current node and not from root ?

    Didnt look like the Element class supported querying for subtree using xpath, Is there a workaround ?

    Many Thanks!
    Prateek
    Missing User
     answered on 17 Jun 2010
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Top achievements
    Rank 1
    Iron
    Iron
    Iron
    Rob
    Top achievements
    Rank 3
    Bronze
    Bronze
    Iron
    ivory
    Top achievements
    Rank 1
    Iron
    Nurik
    Top achievements
    Rank 2
    Iron
    Iron
    YF
    Top achievements
    Rank 1
    Iron
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Top achievements
    Rank 1
    Iron
    Iron
    Iron
    Rob
    Top achievements
    Rank 3
    Bronze
    Bronze
    Iron
    ivory
    Top achievements
    Rank 1
    Iron
    Nurik
    Top achievements
    Rank 2
    Iron
    Iron
    YF
    Top achievements
    Rank 1
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?