Perfecto-Quantum / Quantum-Starter-Kit

Get started with Quantum! Clone or download this repository to start, contains examples of tests and step definitions.
MIT License
58 stars 80 forks source link

switchToDriver not working properly #28

Closed gavrildg2 closed 6 years ago

gavrildg2 commented 6 years ago

I have below switchToDriver method and when I use in more below method clickConversationFromSender it won't switch to receiverDevice. It does the switch on first call on senderDevice but after that it won't switch to receiverDevice because the lstConverstions are retrieved from senderDevice instead of receiverDevice. This was working in previous 10.10 version where it was last tested.

public static void switchToDriver(String driverName) { TestBaseProvider.instance().get().setDriver(driverName + "RemoteDriver"); String envResources = ConfigurationManager.getBundle().getString(driverName + ".env.resources"); ConfigurationManager.getBundle().setProperty("env.resources",envResources); }

public boolean clickConversationFromSender(String senderDevice, String receiverDevice){

DeviceUtilsExtended.switchToDriver(senderDevice); String senderPhoneNo=DeviceUtilsExtended.getDevicePhoneNumber();

DeviceUtilsExtended.switchToDriver(receiverDevice); String receiverPhoneNo=DeviceUtilsExtended.getDevicePhoneNumber();

List lstConverstions = strConversationName.findElements("//android.widget.TextView[contains(@resource-id,'id/conversation_name')]");

........................................................................................... }

gavrildg2 commented 6 years ago

Any suggestions?

hadasshani commented 6 years ago

Hi,

I've tested multi device using the code from example. I was able to get the 2 devices phone numbers. Do you have 2 devices open? Did you get the right numbers but couldn't find the lstConverstions list?

gavrildg2 commented 6 years ago

Yes, both devices are open. I do get the right numbers but the lstConverstions is retrieved from senderDevice instead of receiverDevice.

Something like below. conversation phone no should be the sender phone no but instead it retrieves the conversations from sender device.

[Pixel2 HT76Y1A0]: command: getElementText[ param-1: id: 11 param-2: {"id":"11"}] Result: getElementText:(647) 924-0101 sender phone no=6479240083 receiver phone no=6479240101 conversation phone no=6479240101 [Pixel2 HT76Y1A0]: Executing getElementText element: id: 12 parameters: {"id":"12"} [Pixel2 HT76Y1A0]: command: getElementText[ param-1: id: 12 param-2: {"id":"12"}] Result: getElementText:(647) 924-0107 sender phone no=6479240083 receiver phone no=6479240101 conversation phone no=6479240107

hadasshani commented 6 years ago

Can you share what strConversationName definition is ?

kulin24 commented 6 years ago

Closing this as it has no update.