Unable to single_tap element using Android webdriver, tap area does not line up with the element

81 views
Skip to first unread message

David Tran

unread,
Jun 28, 2013, 2:07:15 PM6/28/13
to seleniu...@googlegroups.com
We have a webpage that has dynamic elements.  When the page is loaded in a mobile device, the elements are created depending on the mobile device.

With the Android Webdriver, when I am tapping an element, it does not line up with the actual element.

Snippet:
require "selenium-webdriver"
require "selenium/client"


include Selenium::WebDriver::DriverExtensions::HasTouchScreen

caps
= Selenium::WebDriver::Remote::Capabilities.android
client
= Selenium::WebDriver::Remote::Http::Default.new
client
.timeout = 480
driver
= Selenium::WebDriver.for(
 
:remote,
 
:url => "http://localhost:8080/wd/hub",
 
:http_client => client,
 
:desired_capabilities => caps)
 

driver
.navigate.to "my page"

next_button
= driver.find_element(:css, "div[id='next_button']")

driver
.touch.single_tap(next_button).perform



When tapping the element, it is tapping in a different area not related to the actual element.

Any help or ideas would be greatly appreciated.

Thanks!

Reply all
Reply to author
Forward
0 new messages