This is a migrated thread and some comments may be shown as answers.

Clicking on button giving the unhandled exception

1 Answer 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amardeep
Top achievements
Rank 1
Amardeep asked on 14 Aug 2013, 10:57 AM
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());
 
      }
  }

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 19 Aug 2013, 11:26 AM
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
Tags
General Discussions
Asked by
Amardeep
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or