-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoogleSearchKiaraWiki_py_test.py
More file actions
31 lines (27 loc) · 948 Bytes
/
Copy pathGoogleSearchKiaraWiki_py_test.py
File metadata and controls
31 lines (27 loc) · 948 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
26
27
28
29
30
31
from selenium import webdriver
import time
import pytest
from selenium.webdriver.common.by import By
class TestGoogleSearchKiara:
@pytest.fixture(scope='module')
def setUpClasstearDownClass(self):
global driver
driver=webdriver.Chrome()
driver.maximize_window()
time.sleep(2)
driver.get('https://www.google.co.in')
print(driver.title)
print(driver.current_url)
time.sleep(2)
yield
driver.close()
def test_kiaraSearch(self,setUpClasstearDownClass):
print("test_kiaraSearch method executes...")
driver.find_element("class name",'gLFyf').send_keys('Kiara Advani')
time.sleep(5)
driver.find_element("class name",'gNO89b').click()
time.sleep(20)
driver.find_element(By.CLASS_NAME,'DKV0Md').click()
time.sleep(10)
print(driver.title)
print(driver.current_url)