Unable to Spy Tab controls, it is identifiable when it is in Instrumented mode, that is on checking the instrument Checkbox in object spy window

The tab items Home and Patients are not identified as shown in below figure in non instrumented mode (Picture1), However they are identified in Instrumented mode Instrument Checkbox is checked,(Picture 2)
But when I copy the xpath from Instrumented mode and put it in the code at run time it doesnot identify the control.

I have also used this code, -

  1. dc.SetCapability(“instrumentApp”, true);

This is when Instrumented checkbox is unchecked.

This is when Instrumented checkbox is checked.

The issue is when I try to take the xpath, from second screenshot that is in instrumented mode, It doesnot identify.
I have the code in Visual studio C#
driver.FindElements(By.XPath(“xpath=//*[@text=Patients]”));

Hi @ravizeiss,

Could you share a bit more from your code? I am not sure if it a typo or if you are using driver.FindElements(By.XPath(“xpath=//*[@text=Patients]”));

Generally we only use findElements when we want to store it into a List/Array and do something with the items, in your case it should just be:

driver.findElement(By.Xpath(“xpath=//*[@text=Patients]”));

I believe you need to use quotes around the text value

driver.FindElements(By.XPath(“xpath=//*[@text=‘Patients’]”));

Good catch :slight_smile: Did not notice that one