cancel
Showing results for 
Search instead for 
Did you mean: 

Device loop does not return correct value for Aliases.Device.Name

Occasional Contributor

Device loop does not return correct value for Aliases.Device.Name

I have a very simple device loop. And i have 2 devices connected to my laptop. One is an android device SM-G960W and another is an iphone.

image.png

The issue i am noticing is that, when i put a debug point on the Log message here and check the value of the following, they return different values. Since 2 devices are connected, the above test will run for 2 iterations.

 

Iteration 1:

image.png

 

Iteration 2:

 

2.png

While Mobile.Device().Name is returning the correct value, Aliases.Device.Name is always returns the 1st device that i connected to my machine out of the 2 devices connected. In the case above, Android device is connected first and Aliases.Device.Name is returning the android device for both the iterations.

 

Any idea how to fix this issue? 

 

Thanks,

Sridhar.

5 REPLIES 5
Highlighted
Community Hero

Re: Device loop does not return correct value for Aliases.Device.Name

Hi,

 

Consider .RefreshMappingInfo() method to get the explanation and get rid of the problem.

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/refres...

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Device loop does not return correct value for Aliases.Device.Name

Tried that. But, it still did not work for me.

 

I tried RefreshMappingInfo() for the name mapping item that i am interested in, which is a text field in this case.

 

Mobile.Device().Name prints the correct ios device name for me.

Aliases.Device.FullName still show the android device name. I expect to see the android device.

 

As i explained in my post, Aliases.Device.FullName is always disaplaying the device that is connected first to the computer.

 

I have also tried setting the ios device using Mobile.SetCurrent("ios_device_name", 1);

and performed RefreshMappingInfo() for the name mapping item that i am interested in.

but Aliases.Device.FullName still prints the andoid device.

New Member

Re: Device loop does not return correct value for Aliases.Device.Name

gak tau

Community Hero

Re: Device loop does not return correct value for Aliases.Device.Name

Hi,

 

Have you tried

Aliases.Device.RefreshMappingInfo() ?

 

Also, how your device is mapped in NameMapping?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Device loop does not return correct value for Aliases.Device.Name

I figured it out. It is the issue with the way i did my name mapping. All good now. Thanks a lot.