1

I have a simple app which contains a SeekBar, which I want to drag up untill the end.

enter image description here

As per this SO post, I added this code block

get_seekbar = driver.find_element_by_class_name('android.widget.SeekBar')
start = get_seekbar.location.get('x')
print(start)

end = get_seekbar.size.get('width')
print(end)

ycd = get_seekbar.location.get('y')
print(ycd)

TouchAction.tap(get_seekbar).move_to(end,ycd).release().perform()
#Tried it with press and long_press methods also but got same error
#TouchAction.press(get_seekbar).move_to(end,ycd).release().perform()

time.sleep(5)

which throws this error in the console -

Traceback (most recent call last):
  File "/Users/zac/PycharmProjects/appiumdemo/cute_dogs.py", line 56, in <module>
    TouchAction.tap(get_seekbar).move_to(end,ycd).release().perform()
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/common/touch_action.py", line 44, in tap
    opts = self._get_opts(element, x, y)
AttributeError: 'WebElement' object has no attribute '_get_opts'

What am I doing incorrectly here? I tried providing the element in the move_to method which again raised another exception.

What's the correct approach to handle such a seekBar? For reference, the debug apk can be found on this link.

demouser123
  • 4,108
  • 9
  • 50
  • 82

0 Answers0