Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

unittest

python tests/unittest/test_SeleniumUnittest.py
test_page_title (__main__.GoogleTestCase)
Assert that title of page says 'Google'. ... ok
test_search_page_title (__main__.GoogleTestCase)
Assert that Google search returns data for 'Red Hat'. ... ok

----------------------------------------------------------------------
Ran 2 tests in 7.765s

OK
Comment

unittest

import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By

class PythonOrgSearch(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox()

    def test_search_in_python_org(self):
        driver = self.driver
        driver.get("http://www.python.org")
        self.assertIn("Python", driver.title)
        elem = driver.find_element(By.NAME, "q")
        elem.send_keys("pycon")
        elem.send_keys(Keys.RETURN)
        self.assertNotIn("No results found.", driver.page_source)


    def tearDown(self):
        self.driver.close()

if __name__ == "__main__":
    unittest.main()
Comment

PREVIOUS NEXT
Code Example
Python :: python variable type 
Python :: how to add number in tuple 
Python :: python add 
Python :: python cast to int 
Python :: floor python 
Python :: search object in array python 
Python :: image to vector conversion function 
Python :: interpreter in python 
Python :: Showing all column names and indexes dataframe python 
Python :: min and max in python 
Python :: pivot tables pandas explicación 
Python :: get center position of countries geopandas 
Python :: replace NaN value in pandas data frame with zeros 
Python :: convert string input into a nested tuple in python 
Python :: load py file converted from .ui file 
Python :: TypeError: Object of type DictProxy is not JSON serializable 
Python :: for x in range(1, 10, 3): print(x) 
Python :: Spatial Reference arcpy 
Python :: function palindrome python 
Python :: star question in pyton 
Python :: #Combine two sets on python with for loop 
Python :: python with statement variables 
Python :: np array specified lengte same value 
Python :: fungsi untuk mengecek apakah ada data yang kosong 
Python :: pandas dtodays date csv 
Python :: sort vs sorted python 
Python :: dictionary in python commands 
Python :: iversao de matriz python 
Python :: nested list flask 
Python :: python: dunder init method 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =