Forum Discussion

anumolu9999's avatar
anumolu9999
Contributor
5 years ago

Issue with 'SelectItemWithValue' method and its input parameters

I am using 'SelectItemWithValue' method to select a value in 'dropdown' control.

 

The above method is working in my machine only when I pass two parameters to the method as below

controlObj.SelectItemWithValue("optoin1",true);

 

When same script copied and run in another machine, the method is accepting only one parameter as below

controlObj.SelectItemWithValue("optoin1");

 

I am using  Same script and Same version of testcomplete in both machines. Difference is one is WIN10 and other WIN7, I don't think this is the reason for the above issue

 

Can you please help to handle this

 

tristaanogre SebastianP : guys please help to handle

  • BenoitB's avatar
    BenoitB
    5 years ago

    Ah ..  so you have clearly the answer !

    net version is finally the difference, try to upgrade on 4.8 on the three machines

     

  • BenoitB's avatar
    BenoitB
    Community Hero

    It can.  If not same version of OS you could have differences in core librairies.

    Is it an application base on .net core ?

    Check the .net version on both machine.

     

    While waiting to find the root cause you can use a quick fix :

    function SelectItemByValue(ObjectToUse, Value, TrueOrFalse = true) {
      // Check major version of windows, 6 = win7, 10 = win10
      aqEnvironment.GetWinMajorVersion() == 6 ? ObjectToUse.SelectItemWithValue(Value) : ObjectToUse.SelectItemWithValue(Value, TrueOrFalse);
    }