Saturday, January 5, 2013

Ranorex test automation issue: Unable to reliably click a button on silverlight web app

Ranorex test automation issue: Unable to reliably click a button on silverlight web app

We have automated a few test cases using the Ranorex automation framework for a Silverlight web application. These test cases involve clicking buttons in order to invoke certain messages on the screen. In order to grab the button on the screen, we first create an Ranorex button object and then point it to the appropriate element using Ranorexpath. Then, we use the RanorexButton.Click() event to click the button. However, this event is unreliable. It works sometimes and at other times the button is not clicked. When the button is not clicked, we have to run the test case again from the start. What are we doing wrong? If this is a known problem of ranorex, please suggest workarounds.

Answers & Comments...

Answer: 1

I haven't heard about such a problem with Ranorex yet, maybe this is just a timing issue. You could add a Validate.Exists(yourButton) right before the click, this ensures that the click is performed after the button was successfully loaded. If it is a WebElement you could also use the PerformClick() method instead of the normal Click() method. There are also different methods which will ensure that the button is in the visible area and has focus, like the EnsureVisible() or the Focus() method. You will find the available methods of the used adapter in the online API of Ranorex.

by : user1948657http://stackoverflow.com/users/1948657




6 comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog