Telerik Forums
Testing Framework Forum
7 answers
195 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
121 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
    95 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
    184 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
    85 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
    66 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
    131 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
    144 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
    159 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
    3 answers
    70 views
    Hi,
    the combination of nested table and an (empty) <td /> tag empty table cell
    causes my test fails in IE8 due to a wrongly interpreted DOM.

    The source DOM is found in code1 the result after asking Webaii for the DOM ist listed in code2.
    The row with the "td3" tag slips out of the outer table of the nested two ones.

    This is observed when asking WebAii for parts of or the whole DOM by e.g.
    - Find.ByNodeIndexPath("1") --> returns the root element which relates to a wrong XML structure as serialized in code2
    - Find.ByNodeIndexPath("1/0/0/1") --> returns NULL when searching for the second row in the outer table.

    When observing the DOM in IE DEveloper Tools the correct DOM is shown (as seen in the attached screenshot of my IE)!
    The same test with FireFox as the defult browsers is sucessfull!

    Html code contains an nested table with an empty, self closing td tag (this html code is generated by our WebApplication Framework so I have almost no control over the html generation.

    Here the htlm souce (code1):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html  xmlns="http://www.w3.org/1999/xhtml">   
      <head> 
        <title> 
          Test  
        </title> 
      </head> 
      <body> 
        <table> 
          <tbody> 
            <tr> 
              <td> 
                <table> 
                  <tbody> 
                    <tr> 
                      <td />                <!-- the problem cell --> 
                      <td id="td2">cell 1,1,1,2</td> 
                    </tr> 
                  </tbody> 
                </table> 
              </td> 
            </tr> 
            <tr> 
              <td id="td3">cell 2,1</td> 
            </tr> 
          </tbody> 
        </table> 
      </body> 
    </html> 

    html code of the DOM structure (serialized) as returned by Find.ByNodeIndexPath("1")
    <body> 
        <table> 
            <tbody> 
                <tr> 
                    <td> 
                        <table> 
                            <tbody></tbody>  
                        </table> 
                    </td> 
                    <tr> 
                        <td> 
                            <td id='td2'></td> 
                        </td> 
                    </tr> 
                </tr> 
            </tbody> 
        </table> 
        <tr> <!-- ROW slipped out of outer table --> 
            <td id='td3'></td> 
        </tr> 
    </body> 

    Thank you for your support -

    Peter Lenz
    Missing User
     answered on 17 Jun 2010
    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?