Friday, April 4, 2008

Handling HTMLText objects in SilkTest

Silktest is always clicking top-left most point of HtmlText object. For example, Assume that my text object is MyApp.MainFrame.Apply

MyApp.MainFrame.Apply.Click () is equal to MyApp.MainFrame.Apply.Click (1,1,1)

Advanced web technologies are always becoming challenges for Automation. Our enterprise web applications have HtmlText object for navigating purpose. We changed all images to text to support localization. These text objects look like HtmlImages or HtmlPushButtons. Actually those are HtmlText objects.

My problem was, sometimes the click will not happen properly. We cannot use DoClick method for HtmlText objects. I had two tricks to solve this problem. One is Clicking on center of that object or blindly hardcode co-ordinates.

In first way, MyApp.MainFrame.Apply.ClickCenter ()
- Here I have extended the click function.

In the second way, MyApp.MainFrame.Apply.Click (1,6,3)

No comments: