1

I have been using Selendroid; it works perfectly for native apps, but for some of the hybrid apps, it is not working properly. With the Employee Directory.apk, Selendroid Inspector works fine (able to get all the IDs), but for another hybrid app which I am trying, Inspector is not able to show the element IDs. Workaround: somehow I got the ID of a button (of a hybrid app) and am able to click on the button, but I want to get the ID from the Selendroid Inspector.

What could be the reason why the Inspector is unable to show these IDs?

Amos M. Carpenter
  • 4,848
  • 4
  • 42
  • 72

2 Answers2

1

If you are using chrome, type this into the address bar

chrome://inspect/#devices.

Just attach a device/emulator, open a browser and click on inspect on the inspect option.

This will let you access the id's, and different properties of the element you want.

You can build XPath addresses using those properties.

Jakuje
  • 24,773
  • 12
  • 69
  • 75
0

When it comes to hybrid apps. Some of the buttons might not have ids. It all depends if the developer added the ID. So you have to resort to cssSelectors, xpath or smth else. I asked the developer of the app i was testing to add id's to the button.

Madis Kangro
  • 293
  • 3
  • 12
  • Also I tend to use Chrome inspect function to check the hybrid app ID's and so on, because it is basically a website source code. You might give a shot there. Just add this line to the address bar in chrome. chrome://inspect/#devices <- works on android 4.4. You can use an emulator or a real device make sure it is attached to your computer – Madis Kangro May 12 '15 at 09:18
  • Hi Madis Kangro, Thanks for the reply , Yeah it has css as well as Class property but the Selendroid Inspector is not showing . – satish sarakanam May 13 '15 at 10:15
  • Thank You So much for chrome://inspect/#devices . I am able to get ids :) – satish sarakanam May 13 '15 at 10:23
  • Selendroid is re installing the Application everytime when i start automation . How can i avoid that . My application has LOgin screen , even after logging in , for the next execution Selendroid is again re installing the Application . So again i am getting the login screen . – satish sarakanam May 13 '15 at 12:05
  • 1
    config.setForceReinstall(false); Which means it wont reinstall the app. config.setNoClearData(true); If you dont wanna clear the cache from your app. – Madis Kangro May 13 '15 at 12:13
  • Thanks Madis Kangro , am starting the Server from Command Prompt using "java -jar ....." how can i give setForceReinstall(false) property in the command . – satish sarakanam May 14 '15 at 05:29
  • Sorry for the late reply. I would say yes, but i havent ran that many programs on it. But atm it has been working fine for me. – Madis Kangro May 26 '15 at 07:57