Forum Discussion

bulaboy_1's avatar
bulaboy_1
New Contributor
15 years ago

TC6 - Selecting item combo box in IE8

Hi there



I know there is an issue with trying to select items in a combo box list on IE8, which is fixed in TC7.5

However, I'm stuck with TC6 for the moment - does anyone have an idea of a work-around to get past this?

I'm using the ClickItem method on a <select> object.



Cheers



N.

7 Replies

  • Hi,



    I'd recommend that you try using the selectedItem property instead of ClickItem. Does this help?

  • bulaboy_1's avatar
    bulaboy_1
    New Contributor
    Hi Jared



    Thanks for your prompt reply. selectedItem doesn't seem to be a property I can access for this particular object in TC6 (6.53.454.7).

    I have selectedIndex property - but I need to be able to select an element from a dropdown box - which I can see ClickItem seems to be the only method for doing so. Any suggestions?



    Thanks



    N.
  • Hi,



    In this case, it looks like you need to upgrade TC. TC 6 doesn't support IE 8, and we cannot guarantee that it will work with this browser.

  • I am using Test complete 7.5... and it recognizes click and selectedIndex, but ClickItem does not work.
  • Hi,



    Do you use TC 7.52 or 7.50? If you use 7.50, install the latest update. If this doesn't help, let us know exactly what happens when you call ClickItem. Do you see errors in the log?

  • cbruck_1's avatar
    cbruck_1
    Occasional Contributor
    I had to use TC 6 at my previous employer after TC 7 was released.  Here's a snippet from our framework that I think might accomplish what you're looking for.  Basically, you have to search through the children of the object and check their value (apparently for some it was contained in .text, hence the multiple conditions on the if statement).  When you find it, you set the .value property for the object and fire the "onchange" event.  I think this effecticely does a ClickItem (after finding the right item in the list).



    case "SELECT" : {

      for (var i = 0; i < fieldObject.children.length; i++) { 

        if ((uppercase(value) == uppercase(fieldObject.children.value)) ||

            (uppercase(value) == uppercase(fieldObject.children.text))) { 

          returnText = stripJunk(fieldObject.children.value); //return the text of the selected entry.

          fieldObject.value = fieldObject.children.value;

          fieldObject.FireEvent("onchange");

          server.Page.Wait();

        }

      }

      return returnText;

      break;

    }