How to access a webkit based site on android via selenium webdriver

I am writing an automated test case for a website that uses webkit, specifically sqlite. When I attempt to do this with Selenium webdriver on an Android device, it just loads a blank screen.

I have set 'databaseEnabled' in desiredCapabilities to True.

I have been able to both access the site from the same Android device's normal web browser, and using webdriver on an iOS based device.

The problem can be seen if you navigate to this page: Database Test Page, Which comes from: mobilehtml5

When you access it from a normal Android browser, you can add scores as expected. If you try to do the same with the following python code, then no change is made to the page:

import selenium
from selenium import webdriver

phoneAddress = "http://172.28.0.79:8080/wd/hub"
dbTest = "http://zdiles.chaosnet.org/dbTest.html"

androidDes = webdriver.common.desired_capabilities.DesiredCapabilities.ANDROID
androidDes['databaseEnabled'] = True

driver = webdriver.remote.webdriver.WebDriver(phoneAddress, androidDes)

driver.get(dbTest)

driver.find_element_by_id("email").send_keys("test")
driver.find_element_by_id("upload").click()

This appears to be the result of a bug in android's WebDriver. For more details on the bug's status see: Issue 4494

链接地址: http://www.djcxy.com/p/62562.html

上一篇: 在自定义webkit浏览器上使用Selenium webdriver

下一篇: 如何通过selenium webdriver在android上访问基于webkit的网站