Hi,
When I try to find elements which are actually some 5 or 6 buttons, i used a common xpath that will point to all the 5 buttons and I loop to find its attributes or click it. But what it does is finding elements using instance and displaying like “Element is null: (0) Element is null: (1)”. And the count also it is not returning correctly, If 5 buttons are present it returns like 30 or some wrong count based on the Element is null’s count.
The server log is displayed like,
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //[@class=‘android.widget.FrameLayout’]/[@class=‘android.widget.RelativeLayout’]/*[@class=‘android.widget.Button’] using XPATH with the contextId: multiple: true
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=7]
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (0)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (1)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (2)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (3)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (4)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (5)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (6)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (7)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (8)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (9)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (10)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (11)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (12)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (13)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (14)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (15)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (16)
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=8]
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (0)
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (1)
Here I expect the count as 9, but the null element count is 13, so it returns as 144. I am not sure why this is happening. Anyone kindly help.
Thanks,
Vinoth.