android - Scrolling layout in automatic test -
i develop automatic test in selenium appium using python. need scroll item list, don't have idea, how it. try:
scrolllayout = android.driver.find_elements_by_class_name("android.widget.relativelayout") params = {"element": scrolllayout[0].id, "text": search_string} self.android.driver.execute_script("mobile: scrollto", params)
but, it's not working. should do?
webelement list = driver.findelement(by.id("id of list")); hashmap<string, string> scrollobject = new hashmap<string, string>(); scrollobject.put("text", "name search"); scrollobject.put("element",( (remotewebelement) list).getid()); driver.executescript("mobile: scrollto", scrollobject); if(scrollobject.containsvalue("string search")) { system.out.println("found"); list<webelement> list_user = list.findelements(by.id("id of text view")); (webelement component : list_user) { system.out.println(component.gettext()); if (component.gettext().contains("string search")) { component.click(); break; } else { system.out.println("not equal"); } } } else { system.out.println("not found"); }
Comments
Post a Comment