Clicking on button giving the unhandled exception

2 posts, 0 answers
  1. Amardeep
    Amardeep avatar
    7 posts
    Member since:
    Feb 2013

    Posted 14 Aug 2013 Link to this post

    HI,

    I am trying to click on the button on silverlight application but its throwing an exception. I have used the same method for clicking on other button where it worked. Not sure why it is throwing an exception here.
    public void OpenChartTemplate()
      {
     
          ClickChartButton(ControlsDefinition.LoadChartTemplateButton);
     
     
      }
      public void ClickChartButton(string buttonName)
      {
          try
          {
            
              Button button = _app.Find.ByName<Button>(buttonName);
              button.EnsureClickable();
     
              button.User.Click();
              _app.RefreshVisualTrees();
     
          }
          catch (TimeoutException exc)
          {
              Trace.WriteLine("@" + DateTime.Now.ToLongTimeString() + " " + buttonName + " " + exc.ToString());
     
          }
      }
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 19 Aug 2013 Link to this post

    Hello Amardeep,

    There are several possible reasons for that issue:

    1. If the button is not present on the visible screen. Unfortunately there is a limitation of the Visual Tree contained in the Silverlight engine. Silverlight puts into the Visual Tree only the UI components necessary to render the page on the screen. You can count only the already rendered rows on the screen.

    You need to scroll to that button first and then find it.

    2. The button is loading too slow, you should add a wait for exists step.

    If the issue persists please: 

    1. Send us the entire trace log.

    2. Please record a Jing video demonstrating the entire process, so we can better understand what is happening. 

    3. Please provide us with a copy of your test and if it is possible grant us access to your application so we can reproduce the issue on our end and give you a solution. If it is not possible to grant us access to your application, please take a Fiddler trace and attach it to a support ticket in a zip file. You can capture a Fiddler trace using FiddlerCap.

    Hope to hear from you soon. 

    Regards,
    Boyan Boev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top