Topic
2 replies Latest Post - ‏2012-10-10T14:01:41Z by SystemAdmin
SystemAdmin
SystemAdmin
16727 Posts
ACCEPTED ANSWER

Pinned topic IE9 with RFT 8.2.1 - Problem interacting with disabled html list elements

‏2012-10-05T16:26:31Z |
I wonder if anyone has seen this problem and come up with a workaround.

We have a large suite of RFT scripts to test an MIS function that is currently only supported on IE8, there has been a body of work done to support IE9 and I am looking to bring our scripts in line with this.

I use utility code to determine if a TestObject is enabled/disabled, this interrogates the properties and looks for class property values to confirm the type of object and then goes on to determine if the Object is enabled/disabled in a manner appropriate to the type of object in out implementation.

This code works just fine on IE8 (please not i am of course using properties specific to the application to determine this).

Under IE9 this seems to be fine unless the supplied object is a list and is disabled. In this case the TestObject fails to be resolved (I can see it using the Highlight function, it comes back very quickly) I have tried updating the properties when it is in this state and no issues are reported but non the less I receive the following exception (when using the display feature of the debugger) if I try to interrogate the objects properties (e.g. String tag = (String)to.getProperty(".class");)

com.rational.test.ft.ObjectNotFoundException: CRFCN0565E: Script playback cannot be completed as the test object is not in the correct state.
Looking for SelectGuiSubitemTestObject(Name: list_locAssetsInquiry_warehouseDescription, Map: contentViewFragment1FormLocationAssetsSearchDdlAssetWarehouse) with state VISIBLE, possibile failing candidate{.text=All, .id=content:viewFragment1:formLocationAssetsSearch:ddlAssetWarehouse, .title=, .name=content:viewFragment1:formLocationAssetsSearch:ddlAssetWarehouse, .classIndex=2} with incorrect state DISABLED
at com.rational.test.ft.object.manager.TestObjectMethodInvoker.findObjectAndInvokeInternal(TestObjectMethodInvoker.java:718)
at com.rational.test.ft.object.manager.TestObjectMethodInvoker.findObjectAndInvoke(TestObjectMethodInvoker.java:419)
at com.rational.test.ft.object.manager.ObjectManager.findObjectAndInvoke(ObjectManager.java:341)

... so clearly the field is now being recognised differently within the engine. Fields on the same page are quite clearly enabled so it's not a page isn't loaded issue.

Any suggestions, is this a known issue I have somehow missed?

Nathan
Updated on 2012-10-10T14:01:41Z at 2012-10-10T14:01:41Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    16727 Posts
    ACCEPTED ANSWER

    Re: IE9 with RFT 8.2.1 - Problem interacting with disabled html list elements

    ‏2012-10-05T21:13:40Z  in response to SystemAdmin
    To add a little detail after an afternoon of staring at the problem:

    There appears to be a mismatch between the way that RFT ‘discovers’ disable list elements between IE8 and IE9.
    IE8 example; list_locAssetsInquiry_warehouseDescription()
    IE9 example; list_locAssetsInquiry_warehouseDescription(ANY,DISABLED)

    the examples above don't work on the other browser, so it's clearly something object state causing the problem. Any approaches around the issue that anyone can suggest short of writing a second script?
    • SystemAdmin
      SystemAdmin
      16727 Posts
      ACCEPTED ANSWER

      Re: IE9 with RFT 8.2.1 - Problem interacting with disabled html list elements

      ‏2012-10-10T14:01:41Z  in response to SystemAdmin
      Currently using a workaround based ont he find method, added it here in case somebody else is having the same issue and no answer is presented.

      public static final TestObject findDialogue(int waitSeconds) {
      TestObject[] found = RationalTestScript.find(RationalTestScript.atDescendant(".class","Html.Dialog"));
      for (int i=0;found.length == 0&&i<waitSeconds;i++) {
      try {Thread.sleep(1000);} catch (InterruptedException e) {} // wait for a second if the dialogue isn't present
      found = RationalTestScript.find(RationalTestScript.atDescendant(".class","Html.Dialog"));
      }
      if (found.length == 1) return found[0];
      else if (found.length == 0) throw new IllegalStateException("No Dialogue box found, one was expected.");
      else throw new IllegalStateException("Multiple Dialogue boxes found, no mechanism to distingush between these.");
      }