-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathssertionsSSS.py
More file actions
27 lines (20 loc) · 784 Bytes
/
ssertionsSSS.py
File metadata and controls
27 lines (20 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import unittest
from selenium import webdriver
class SearchTests (unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps['platform'] = 'WINDOWS'
desired_caps['browserName'] = 'internet explorer'
self.a = webdriver.Remote('http://192.168.1.5:4444/wd/hub',desired_caps)
self.a.ignoreZoomSetting=True
self.a.get("http://magento-demo.lexiconn.com/")
self.a.maximize_window()
def test_search(self):
self.a.find_element_by_xpath("//input[@id='search']").send_keys("Bed & Bath")
self.a.find_element_by_xpath("//input[@id='search']").submit()
lis = self.a.find_elements_by_xpath("//h2[@class='product-name']/a")
self.assertEqual(12, len(lis))
def tearDown(self):
self.a.close()
if __name__ == '__main__':
unittest.main(verbosity=2)