1

I've successfully loaded my test app on Android emulator and real device using Selendroid. When i run my test case in debug mode and get into the inspector, the left panel (app's image) works fine, but loading the tree gets 500 error, Internal Server Error.

In addition, I'm unable to find elements on my app. Every element i'm looking for, even regular div's, gets NoSuchElement in response. My app is indeed Hybrid, but when i'm trying to switch to WEBVIEW, I get an error. When I switch to NATIVE_APP, the test cases keep going but still no elements are found.

It's the same case whether I'm using emulator or real device.

My code is written in Python and looks like this:

import unittest
from selenium import webdriver



class FindElementTest(unittest.TestCase):

    def setUp(self):
        caps = {'aut': 'app:version'}

        self.driver = webdriver.Remote(
            desired_capabilities=caps
        )
        self.driver.implicitly_wait(10)

    def test_find_element_by_id(self):
        driver = self.driver
        driver.get('and-activity://app..MainActivity')
        driver.implicitly_wait(5)
        driver.switch_to.window('WEBVIEW')
        driver.find_element_by_class_name('login').click()
Avraham
  • 11
  • 1
  • Just some questions regarding your app. Is it a IONIC app? It has problems with the selendroid inspector. (I tend to use chrome inspect for hybrid apps). Also try to get all the windowhandles with python. There are quite often more than 1 webview. So you have to change to a specific webview. Like WEBVIEW_0; – Madis Kangro Aug 11 '15 at 13:55
  • Thanks for your response. – Avraham Aug 12 '15 at 15:50
  • My app is not IONIC. When I use windowhandles with python, it returns only 1 window, [1] spot in the returned array is empty.. – Avraham Aug 12 '15 at 16:00

0 Answers0