This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 3
Jan 2019

I have an element that come up as “foo ” (attribute name) in appium inspector.

I’ve tried using self.wd.find_element_by_id(“foo ”) but getting an error in python…

“SyntaxError: Non-ASCII character ‘\xef’ in file working.py on line 51, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details”

Is there another partial text search I can do so that I can search for “foo” and I’ll be able to select the element?

Tried using find_elements_by_xpath("//*[contains(text(), ‘foo’)]")

But I’m getting the following error

NameError: global name ‘find_elements_by_xpath’ is not defined

Is there an alternative method I can use?

  • created

    Jan '19
  • last reply

    Jan '19
  • 2

    replies

  • 110

    views

  • 2

    users

  • 1

    like

  • 2

    links

Was able to resolve this issue after adding the following to the beginning of the file…

#!/usr/bin/env python

-- coding: utf-8 --

now self.wd.find_element_by_id(“foo ”) works