Om en felaktig URL anges ska en fin felsida visas:
Testet i Selenium anger en felaktig URl och letar efter texterna "Sidan gick inte att hitta" och "The page could not be found".
Selenium IDE -test ( python):
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
From @lalindqv on February 23, 2015 10:7
Om en felaktig URL anges ska en fin felsida visas:
Testet i Selenium anger en felaktig URl och letar efter texterna "Sidan gick inte att hitta" och "The page could not be found".
Selenium IDE -test ( python):
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest, time, re
class Felsida(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.base_url = "http://change-this-to-the-site-you-are-testing/" self.verificationErrors = [] self.accept_next_alert = True
if name == "main": unittest.main()
Copied from original issue: rinfo/lagrummet.se#386