Selendroid: How to get image of RadioButton

122 views Asked by At

I'm using selendroid to test native android application. I need to read displayed image of RadioButton (it's an icon that can change).

I tried following approaches:

1) Using WebElement. WebElement interface doesn't have any method like getImage. I suppose that getAttribute() should be used (I'm using it in web selenium), but I don't know which attributes are supported (image, drawable, button, android:button are not..)

2) Calling driver.getPageSource(). This looked promising, but XML like this was returned:

<LinearLayout name="" label="" value="" ref="461c3985-6e34-df57-fd11-070646350c40" id="" shown="true">
    <rect x="206" y="279" height="64" width="78"/>
    <RadioButton name="" label="" value="" ref="520242c7-8a82-3779-ba07-c926c271c58f" id="" shown="true">
        <rect x="206" y="279" height="64" width="78"/>
    </RadioButton>
</LinearLayout>

So it doesn't contain any useful information

3) Finaly I used DDMS - Android Debug Monitor and dumped view hierarchy and even here I couldn't find the image.

Questions:

  1. How can I read the image of RadioButton (and of CheckBox and ImageView) using selendroid?
  2. Which attributes can be used in getAttribute()? Are they listed somewhere?
0

There are 0 answers