Skip to content

Commit aae00eb

Browse files
Update alert tests to pass in element id instead of string of frame
1 parent 2b27cbb commit aae00eb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

py/test/selenium/webdriver/common/alerts_tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
import unittest
2929

30-
30+
@pytest.mark.ignore_marionette
3131
class AlertsTest(unittest.TestCase):
3232
def testShouldBeAbleToOverrideTheWindowAlertMethod(self):
3333
if self.driver.capabilities['browserName'] == 'phantomjs':
@@ -165,7 +165,7 @@ def testShouldAllowUsersToAcceptAnAlertInAFrame(self):
165165
if self.driver.capabilities['browserName'] == 'phantomjs':
166166
pytest.xfail("phantomjs driver does not support alerts")
167167
self._loadPage("alerts")
168-
self.driver.switch_to.frame("iframeWithAlert")
168+
self.driver.switch_to.frame(self.driver.find_element(By.NAME, "iframeWithAlert"))
169169
self.driver.find_element_by_id("alertInFrame").click()
170170

171171
alert = self._waitForAlert()
@@ -177,8 +177,8 @@ def testShouldAllowUsersToAcceptAnAlertInANestedFrame(self):
177177
if self.driver.capabilities['browserName'] == 'phantomjs':
178178
pytest.xfail("phantomjs driver does not support alerts")
179179
self._loadPage("alerts")
180-
self.driver.switch_to.frame("iframeWithIframe")
181-
self.driver.switch_to.frame("iframeWithAlert")
180+
self.driver.switch_to.frame(self.driver.find_element(By.NAME, "iframeWithIframe"))
181+
self.driver.switch_to.frame(self.driver.find_element(By.NAME, "iframeWithAlert"))
182182

183183
self.driver.find_element_by_id("alertInFrame").click()
184184

@@ -250,7 +250,7 @@ def testShouldAllowTheUserToGetTheTextOfAnAlert(self):
250250
value = alert.text
251251
alert.accept()
252252
self.assertEqual("cheese", value)
253-
253+
254254
def testUnexpectedAlertPresentExceptionContainsAlertText(self):
255255
if self.driver.capabilities['browserName'] == 'phantomjs':
256256
pytest.xfail("phantomjs driver does not support alerts")

0 commit comments

Comments
 (0)