Topic
  • 4 replies
  • Latest Post - ‏2012-10-09T14:49:17Z by testguy
vishalendu
vishalendu
3 Posts

Pinned topic Replay of script recorded on FF10 for dojo based application not working

‏2012-10-03T06:46:10Z |
Hi All,

I am doing a POC on whether we can use RFT for recording Functional Flows for our application. Please bear with me if i sound novice.

I am using RFT 8.2.2.1 on Windows XP, and am trying to record a simple Login and Logout test. I am using the "java scripting" mode for recording to get a proper java class as a recorded test case.

When I record the test, I get the main method, something like this:

public void testMain(Object[] args)
{
startApp("XYZ 131");

// HTML Browser
// Document: Application Name: http://IPaddress/xyz/xyz/login.do
html_login().waitForExistence();
text_username().click(atPoint(78,6));
browser_htmlBrowser(document_aaa(),DEFAULT_FLAGS).inputChars("xyz");
text_password().click(atPoint(36,13));
browser_htmlBrowser(document_aaa(),DEFAULT_FLAGS).inputChars("xyz");
button_login().click();
// Document: Application Name: http://IPaddress/xyz/xyz/processLogin.do
tabContainer_homeX().waitForExistence();
html_appHeader().click(atPoint(1017,27));
menu_dijit_Menu_0().click(atPath("Logout"));
}

This test has following steps:
1) Open Login screen, wait for it to load.
2) Click username textbox, enter username
3) Click password textbox, enter password
4) Click login
5) Wait for next screen to load
6) Logout.

When I replay the recorded script, the script is stuck at:
text_username().click()

And, I get the following Exception:
Could not find a Text role attribute for the object.
com.rational.test.ft.ObjectNotFoundException
at com.rational.test.ft.object.interfaces.ClientTestObject.invokeProxy(ClientTestObject.java:411)
at com.rational.test.ft.object.interfaces.GuiTestObject.click(GuiTestObject.java:624)
at dojo_7.testMain(dojo_7.java:37)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
at org.eclipse.core.launcher.Main.main(Main.java:34)

However, when I change the browser to IE8 (in Configure Applications for Testing), the same script runs without any problem.

Can someone explain if this is an RFT issue or a product issue (not proper support for FF in my product).

Thanks,
Vishalendu
Updated on 2012-10-09T14:49:17Z at 2012-10-09T14:49:17Z by testguy
  • vishalendu
    vishalendu
    3 Posts

    Re: Replay of script recorded on FF10 for dojo based application not working

    ‏2012-10-08T07:09:46Z  
    Can anyone please reply to my question.

    We have the following options:
    If this issue is because of RFT, we will need this to be fixed from Rational. And this would be a showstopper.
    If this issue is because of my product, we can get it fixed from our Development and still be able to use RFT.

    If we can get an understanding about the cause of this issue, we can decide whether we can use RFT for our automation or we need to look for other alternatives.

    Thanks in advance,
    Vishalendu
  • testguy
    testguy
    3 Posts

    Re: Replay of script recorded on FF10 for dojo based application not working

    ‏2012-10-08T14:46:10Z  
    Hi Vishalendu,

    Have to tried "stepping" throught the code in debug mode?

    It might be possible that the script is executing too fast and the browser is too slow to load.
    You can either step in the various lines of code using RFT, or maybe just add a statement to wait for the username edit box to be displayed, as in:
    text_username().waitForExistence(); (using the code you supplied).

    I have experienced issues like that using recorded scripts a long time ago (I no longer do that), and older browser (IE 6 and IE7).

    My scripts now wait for specific controls to be available before continuing running.

    Have a good day,

    André
  • vishalendu
    vishalendu
    3 Posts

    Re: Replay of script recorded on FF10 for dojo based application not working

    ‏2012-10-09T08:07:19Z  
    • testguy
    • ‏2012-10-08T14:46:10Z
    Hi Vishalendu,

    Have to tried "stepping" throught the code in debug mode?

    It might be possible that the script is executing too fast and the browser is too slow to load.
    You can either step in the various lines of code using RFT, or maybe just add a statement to wait for the username edit box to be displayed, as in:
    text_username().waitForExistence(); (using the code you supplied).

    I have experienced issues like that using recorded scripts a long time ago (I no longer do that), and older browser (IE 6 and IE7).

    My scripts now wait for specific controls to be available before continuing running.

    Have a good day,

    André
    Hi André,

    Thanks for your reply.

    The "waitForExistence()" method I have used (as you can see in my initial post) will wait till the login form is loaded. This login form has the "username" and "password" fields. So I dont think that the script is running too fast. To double check I had also added thinktime between the form load and the click on the username text box, but that doesnt change anything.

    The reasons I posted here was because I was out of ideas on the troubleshooting. If there is no way to troubleshoot this issue, I would perhaps log a PMR for this.

    As far as I can guess, the RFT is not able to identify the text box even though it is there. Is there anyway, in which I can just print/log all the elements on a screen to some log, this way I can check whether the text box has loaded for RFT or not.

    Thanks,
    Vishalendu
  • testguy
    testguy
    3 Posts

    Re: Replay of script recorded on FF10 for dojo based application not working

    ‏2012-10-09T14:49:17Z  
    Hi André,

    Thanks for your reply.

    The "waitForExistence()" method I have used (as you can see in my initial post) will wait till the login form is loaded. This login form has the "username" and "password" fields. So I dont think that the script is running too fast. To double check I had also added thinktime between the form load and the click on the username text box, but that doesnt change anything.

    The reasons I posted here was because I was out of ideas on the troubleshooting. If there is no way to troubleshoot this issue, I would perhaps log a PMR for this.

    As far as I can guess, the RFT is not able to identify the text box even though it is there. Is there anyway, in which I can just print/log all the elements on a screen to some log, this way I can check whether the text box has loaded for RFT or not.

    Thanks,
    Vishalendu
    Hi Vishalendu,

    I have encountered problems when waiting for a form to load. Sometimes, RFT seems to think that, if IE (which is the browser that I am using) has display some of field on the screen, the page is loaded.

    That is why, in my tests, I wait for the browser's existence, and then check for the field's existence (and wait and wait if it is not displayed yet). This solved many problems for me.

    I wrote a routine a while ago to extract all the information from a displayed form.
    The routine get the highest level browser object (root test object), then cycles through all the children items objects of type:
    Radio button
    Link
    List box
    Edit box
    Password (still wrestling with password fields)
    TextArea (Multiline edit boxes)
    buttons and Submit (which are also buttons)
    Image
    Browser Tab
    Tables.

    I am included a modified version of my routine in a file. You may want to modify the code to just report all the properties for each item, as in:
    ... to[i].getProperties().toString());

    I am sure that other people have created better routines, but I just use it whenever I just want to get the names of the elements on the screen while debugging or creating a new script. Nothing fancy here.

    I suggest calling the method once the browser has finished loading all the objects.

    Cheers,

    André