Unable to locate the element using any of the locator stategies


#1

Iam trying to get the list of the all the webelements whose text starts with MOBILE DEPOSIT.I tried with xpath,class,id,accessibility-id. none of them worked.

Interestingly i noticed that i wasnt even able to locate any of the element on the screen.

can some one please help me with this.


#2

@pinky try with:


        List<MobileElement> elements1 = driver.findElements(MobileBy.id("transaction_details"));
        List<MobileElement> elements2 = driver.findElements(MobileBy.AndroidUIAutomator( "new UiSelector().textContains(\"MOBILE DEPOSIT\")"));
        System.out.println("elements1 size: " + elements1.size());
        System.out.println("elements2 size: " + elements2.size());

#3

[quote=“Aleksei, post:2, topic:25083”]
MobileBy.AndroidUIAutomator( “new UiSelector().textContains(“MOBILE DEPOSIT”)”)

Tried that…size of both the lists are zero.

elements1 size :0
elements2 size :0


#4

Try creating Xpath with ClassName and contains text to get the list of elements.


#5

@pinky when you reach programmatically in code this screen try add wait 3-5sec and then get page source with:

System.out.println(driver.getPageSource());

check that you are are able to see your elements with needed text.


#7

Tried that too…but list size is zero.


#8

I added wait and got the pagesource
i am not seeing any of the elements displayed on the screen in the page source.


#9

What you see? Can you share it at gist.com ?


#11

We can see signOff dialog here. You do no see it on screen?


#12

Whenever there is no activity on the page for few mins, signoff popup appears. As i gave long wait and none of the activity happened on the screen, signoff popup appeared…its not part of the screen shown above…