Example #1
0
 def openBrowser(self):
     driver.get(url)
     driver.maximize_window()
     time.sleep(1)
     driver.implicitly_wait(10)
     driver.delete_all_cookies()
     time.sleep(1)
Example #2
0
def test_login():
    driver.get(url1)
    driver.implicitly_wait(6)
    driver.maximize_window()

    pop_up = driver.find_element_by_xpath(
        '//div[@class="Og_iib col col-2-5 _3SWFXF"]').is_displayed()
    if pop_up == True:
        driver.find_element_by_xpath(
            '//input[@class="_2zrpKA _1dBPDZ"]').send_keys(9591593927)
        driver.find_element_by_xpath('//input[@type="password"]').send_keys(
            9880424831)
        driver.find_element_by_xpath(
            '//button[@class="_2AkmmA _1LctnI _7UHT_c"]').click()

    else:
        driver.find_element_by_xpath('//div[@class="_2aUbKa"]').click()
 def get_url(self):
     print("in url")
     driver.get(url[0])
     driver.maximize_window()
Example #4
0
from selenium.webdriver.support.select import Select
from settings import driver

filepath = r'C:\Users\vidya gowda\PycharmProjects\Selenium_DemoProject\html_files\Select_dropdown.html'
import time

driver.get(filepath)
driver.maximize_window()
element = driver.find_element_by_id("cars")
s = Select(element)
s.select_by_value("sub1")
time.sleep(2)
s.select_by_index(3)
time.sleep(2)
s.select_by_visible_text("Mysore")
time.sleep(2)

options = s.options
print(options)
print("all_options are")
for i in options:
    print(i.text)
print()
selected_options = s.all_selected_options
print(selected_options)
print("all_selected_options are")
for i in selected_options:
    print(i.text)
print()
first_selected = s.first_selected_option
print("first_selected_option : ", first_selected.text)
 def get_url(self):
     # driver.get(c_path)
     # driver.get(s_path)
     driver.get(p_path)
     driver.maximize_window()
Example #6
0
 def get_url(self):
     driver.get(url[1])
     driver.maximize_window()