Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6869)

Unified Diff: chrome/test/webdriver/test/chromedriver_tests.py

Issue 7465053: In chromedriver, check if an element is clickable before clicking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/webdriver/test/chromedriver_tests.py
diff --git a/chrome/test/webdriver/test/chromedriver_tests.py b/chrome/test/webdriver/test/chromedriver_tests.py
index 49f5311b5a62a10a857dcf78b8c0027884275811..677621adcfaa496d3172d26fac14f6454c7ff03c 100644
--- a/chrome/test/webdriver/test/chromedriver_tests.py
+++ b/chrome/test/webdriver/test/chromedriver_tests.py
@@ -461,6 +461,11 @@ class MouseTest(ChromeDriverTest):
self._driver.find_element_by_name('wrapped').click()
self.assertTrue(self._driver.execute_script('return window.success'))
+ def testThrowErrorIfNotClickable(self):
+ self._driver.get(GetTestDataUrl() + '/not_clickable.html')
+ elem = self._driver.find_element_by_name('click')
+ self.assertRaises(WebDriverException, elem.click)
+
class TypingTest(ChromeDriverTest):
@@ -819,7 +824,7 @@ class AutofillTest(ChromeDriverTest):
for country_code in test_data:
query = self._SelectOptionXpath(country_code)
- driver.find_element_by_id('country').find_element_by_xpath(query).select()
+ driver.find_element_by_id('country').find_element_by_xpath(query).click()
# Compare postal labels.
actual_postal_label = driver.find_element_by_id(
'postal-code-label').text
@@ -849,9 +854,9 @@ class AutofillTest(ChromeDriverTest):
query_year = self._SelectOptionXpath(
creditcard_data['CREDIT_CARD_EXP_4_DIGIT_YEAR'])
driver.find_element_by_id('expiration-month').find_element_by_xpath(
- query_month).select()
+ query_month).click()
driver.find_element_by_id('expiration-year').find_element_by_xpath(
- query_year).select()
+ query_year).click()
driver.find_element_by_id(
'autofill-edit-credit-card-apply-button').click()
# Refresh the page to ensure the UI is up-to-date.

Powered by Google App Engine
This is Rietveld 408576698