cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with 'SelectItemWithValue' method and its input parameters

SOLVED
Highlighted
Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Issue with 'SelectItemWithValue' method and its input parameters

Ah ..  so you have clearly the answer !

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

 

Un sourire et ça repart

View solution in original post

9 REPLIES 9
Highlighted
Community Leader

Re: Issue with 'SelectItemWithValue' method and its input parameters

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);
}

Un sourire et ça repart

Highlighted
Contributor

Re: Issue with 'SelectItemWithValue' method and its input parameters

Hello @BenoitB ,

 

The application base on .net. I checked both machines, both are having different .net framework versions.

One machine having 4.8 Version and Other machine had 4.6. 

 

Can we get the .NetFramework version into our scripts?

 

Thank you,

Anumolu.

Highlighted
Community Leader

Re: Issue with 'SelectItemWithValue' method and its input parameters

Yes, i suggest you to look at the help .

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/misc/osinfo/properti...

 

 

Un sourire et ça repart

Highlighted
Contributor

Re: Issue with 'SelectItemWithValue' method and its input parameters

Hi @BenoitB ,

 

I had tried to use below OSInfo methods

Log.Message(Sys.OSInfo.NetCoreCount);
Log.Message(Sys.OSInfo.NetCoreVersion(0));
Log.Message(Sys.OSInfo.NetCoreVersion(1));

 

In both machines, the result shows SAME as below

2

v2.0.50727

v4.0.30319

 

There is no differentiation...Can you please help.

 

Thank you,

Anumolu.

Highlighted
Community Leader

Re: Issue with 'SelectItemWithValue' method and its input parameters

that means the pbm is not located on .net version
Both are 32 bits or win 7 is 32 and win 10 is 64.

Have you tried the fix suggested ?

Un sourire et ça repart

Highlighted
Contributor

Re: Issue with 'SelectItemWithValue' method and its input parameters

Hi @BenoitB ,

 

I had tried the workaround you mentioned...but failed.

 

We had multiple test machines here like below

1. WIN10 - (.Net V4.6.2)

2. WIN7 - (.Net V4.6.2)

3. WIN Server 2016 - (.Net4.6.2)

4. WIN10 - (.Net V4.8)

 

 

In  machines 1,2,3 - SelectItemWithValue accepting only one parameter

In 4th machine, SelectItemWithValue accepting two input parameters

 

I don't think, the issue is with the Windows Version. Is there any other ways to handle this?

 

Thank you,

Anumolu.

 

Highlighted
Contributor

Re: Issue with 'SelectItemWithValue' method and its input parameters

forgot to mention:

 

All machines are 64-Bit architecture

 

Thank you,

Anumolu.

Highlighted
Community Leader

Re: Issue with 'SelectItemWithValue' method and its input parameters

Ah ..  so you have clearly the answer !

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

 

Un sourire et ça repart

View solution in original post

Highlighted
Community Manager

Re: Issue with 'SelectItemWithValue' method and its input parameters

Thank you for investigating this Benoit!

 

@anumolu9999 did you try following the advice? Please share your solution🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors