So many factors will affect the automation script play back when you are interacting with application GUI. Once such instance is, where play back fails when RFT tries to perform click action on hyper link control (could be any other control). Though this issue does not consistently happen it might happen intermittently due to application loading speed, RFT play back speed, Application Program Interface (API) used or some other factor as well.
RFT provides API such as sleep(), watiforexistance(),IsVisible().... using which you can handle the play back failure due to above said behavior, however if the issue is not consistent and occurrence of the issue is minimal, introducing sleep() API would consume additional time which could be avoided.
Test Script consist of steps which performs inserting text into number of text fields and then clicking on button, which takes the application to the next page, where RFT needs to perform click action on hyperlink upon loading .
Though the application page has not loaded completely (half page visible to the user), the expected hyperlink control is visible on the screen and RFT tries to perform click action on the control. The moment RFT is about to click, the pages loads completely that makes hyperlink control to move elsewhere and that makes RFT to click on unexpected control which leads to the failure.
Textfiled1.setText(" Name" ) ;
Textfiled2.setText("Address" ) ;
Textfiled3.setText("City" ) ;
Execution of above code snippet might replicate the scenario that we are discussing.
In order to overcome this issue, before performing click action, use getScreenRectangle() API to find the middle point of the control co-ordinate.
By doing this, play back failure could be avoided as RFT relies on co-ordinates of the test object ( not the screen co-ordinates so this script must run in any resolution or screen size )
java.awt.Rectangle r = Hyberlink_AddnewEntry.getScreenRectangle();
java.awt.Point pt = new java.awt.Point(r.x+ r.width/2,r.y+ r.height/2);