blob: 05c3ce8e82352548ba0de5db66c256852035f4f9 [file] [log] [blame]
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import belkinF9K_ap_configurator
import logging
from selenium.common.exceptions import TimeoutException as \
SeleniumTimeoutException
class BelkinF7D1301APConfigurator(
belkinF9K_ap_configurator.BelkinF9KAPConfigurator):
"""Class to configure Belkin F7D1301 v1 (01) router."""
def save_page(self, page_number):
"""
Save changes and logout from the router.
@param page_number: the page number to save as an integer.
"""
button = '//input[@type="submit" and @value="Apply Changes"]'
self.click_button_by_xpath(button,
alert_handler=self._security_alert)
self.set_wait_time(30)
try:
self.wait.until(lambda _:'index.htm' in self.driver.title)
except SeleniumTimeoutException, e:
xpath= '//h1[contains(text(), "Duplicate Administrator")]'
if (self.driver.find_element_by_xpath(xpath)):
logging.debug('We got a \'Duplicate Administrator\' page '
'when we saved the changes.')
else:
raise RuntimeError("We couldn't save the page" + str(e))
finally:
self.restore_default_wait_time()