def startBrowser():
    bwtype = ConfigReader.readConfigData("Details", "Browser")
    App_URL = ConfigReader.readConfigData("Details", "App_URL")
    global driver
    print("inside startbrowser", bwtype)
    if bwtype == "Firefox":

        path = ConfigReader.readConfigData("Details", "drvPath")
        driver = webdriver.Firefox(executable_path=path)
        driver.get(App_URL)
        driver.maximize_window()
    elif bwtype == "Chrome":

        path = ConfigReader.readConfigData("Details", "drvPath")
        driver = webdriver.Chrome(executable_path=path)
        driver.get(App_URL)
        driver.maximize_window()
    else:

        path = ConfigReader.readConfigData("Details", "drvPath")
        driver = webdriver.Chrome(executable_path=path)
        driver.get(App_URL)
        driver.maximize_window()

    return driver
def startbrowser():
    global driver
    # Reading the Browser details from the Configuration file
    if ConfigReader.readConfigData('Details', 'Browser') == "Chrome":
        PATH = "../Driver/chromedriver.exe"
        driver = Chrome(executable_path=PATH)
    elif ConfigReader.readConfigData('Details', 'Browser') == "Firefox":
        PATH = "../Driver/geckodriver.exe"
        driver = Firefox(executable_path=PATH)
    url = ConfigReader.readConfigData('Details', 'Application_URL')
    # driver.maximize()

    return driver
def startBrowser():
    global driver
    path = "C:\\Users\\milin\\PycharmProjects\\chromedriver.exe"
    driver = Chrome(executable_path=path)
    driver.get(ConfigReader.readConfigData('Registration', 'email_name'))
    driver.maximize_window()
    return driver
def startBrowser():
    global driver
    path = "C:/Python38/Scripts/chromedriver.exe"
    driver = Chrome(executable_path=path)
    driver.get(ConfigReader.readConfigData('Details', 'Application_URL'))
    driver.maximize_window()
    return driver
Exemple #5
0
def startBrowser():
    global driver  #to use driver object in different methods in this file

    if ((ConfigReader.readConfigData('Details', 'Browser')) == "chrome"):
        path = "./DriverFiles/chromedriver.exe"
        driver = Chrome(executable_path=path)
    elif ((ConfigReader.readConfigData('Details', 'Browser')) == "Firefox"):
        path = "./DriverFiles/geckodriver.exe"
        driver = Firefox(executable_path=path)
    else:
        path = "./DriverFiles/chromedriver.exe"
        driver = Chrome(executable_path=path)

    driver.get(ConfigReader.readConfigData('Details', 'Application_URL'))
    driver.maximize_window()
    return driver
Exemple #6
0
def startBroswer():
    global driver
    if ConfigReader.readConfigData('Details', 'Application_URL') == "Chrome":
        path = "C:\\Users\\User\\Desktop\\Chrome WebDriver\\chromedriver_win32\\chromedriver.exe"
        driver = Chrome(executable_path=path)
    elif ConfigReader.readConfigData('Details',
                                     'Application_URL') == "Firefox":
        path = "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
        driver = Firefox(executable_path=path)
    else:
        path = "C:\\Users\\User\\Desktop\\Chrome WebDriver\\chromedriver_win32\\chromedriver.exe"
        driver = Chrome(executable_path=path)

    driver.get(ConfigReader.readConfigData('Details', 'Application_URL'))
    driver.implicitly_wait(15)
    driver.maximize_window()
    return driver
Exemple #7
0
def before_scenario(context, scenario):
    if ((ConfigReader.readConfigData('Details', 'Browser')) == "Chrome"):
        path = "./Driver/chromedriver.exe"
        context.driver = Chrome(executable_path=path)
    elif ((ConfigReader.readConfigData('Details', 'Browser')) == "Firefox"):
        path = "./Driver/geckodriver.exe"
        context.driver = Firefox(executable_path=path)
    elif ((ConfigReader.readConfigData('Details', 'Browser')) == "Ie"):
        path = "./Driver/IEDriverServer.exe"
        context.driver = Ie(executable_path=path)
    else:
        path = "./Driver/chromedriver.exe"
        context.driver = Chrome(executable_path=path)

    context.driver.maximize_window()
    context.driver.implicitly_wait(100)
    context.driver.get(
        ConfigReader.readConfigData('Details', 'Application_URL'))
def start_Browser():
    global driver
    if ((ConfigReader.readConfigData('Details', 'Browser')) == "Chrome"):
        path = "./Driver/chromedriver.exe"
        driver = Chrome(executable_path=path)
    elif ((ConfigReader.readConfigData('Details', 'Browser')) == "Firefox"):
        path = "./Driver/geckodriver.exe"
        driver = Firefox(executable_path=path)
    elif ((ConfigReader.readConfigData('Details', 'Browser')) == "ie"):
        path = "./Driver/IEDriverServer.exe"
        driver = ie(executable_path=path)
    else:
        path = "./Driver/chromedriver.exe"
        driver = Chrome(executable_path=path)

    driver.maximize_window()
    driver.implicitly_wait(100)
    driver.get(ConfigReader.readConfigData('Details', 'Application_URL'))
    return driver
def startBrowser():
    global driver
    # To change to brave just go to Config.cfg and change Browser =

    if ((ConfigReader.readConfigData('Details', 'Browser')) == 'chrome'):
        path = '../chromedriver.exe'
        driver = Chrome(executable_path=path)

    elif ((ConfigReader.readConfigData('Details', 'Browser')) == 'firefox'):
        path = '../chromedriver.exe'
        driver = Chrome(executable_path=path)
    else:
        from selenium.webdriver.chrome.options import Options
        path = '../chromedriver.exe'
        options = Options()
        options.binary_location = 'C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe'
        driver = Chrome(options=options, executable_path=path)

    driver.get("https://www.thetestingworld.com/testings")
    driver.maximize_window()
    return driver
def start_browser():
    global driver

    if ((ConfigReader.readConfigData("Details", "Browser")) == "chrome"):
        # path = "./Driver/chromedriver.exe"
        driver=Chrome()

    elif ((ConfigReader.readConfigData("Details", "Browser")) == "firefox"):
        path = "path of gecko driver"
        driver = Firefox(executable_path=path)
    # else:
        """Default browser when no browser is specified or some error happens """
        #path = "/navaneeth/Documents/new_chromedriver/chromedriver.exe"
        # driver = Chrome()


    driver = Chrome()
    driver.get(ConfigReader.readConfigData("Details", "Application_URL"))
    driver.fullscreen_window()

    return driver
def startBrowser():
    global driver
    if ((ConfigReader.readConfigData('Details', 'Browser')) == 'chrome'):
        #driver = webdriver.Chrome("./Driver/chromedriver.exe")
        driver = webdriver.Chrome(
            "C:/Users/Admin/Downloads/Python class docs/chromedriver_win32/chromedriver.exe"
        )

    elif ((ConfigReader.readConfigData('Details', 'Browser')) == 'firefox'):
        driver = webdriver.Firefox(
            executable_path=
            "C:/Users/Admin/Downloads/Python class docs/geckodriver-v0.26.0-win64/geckodriver.exe"
        )
    else:
        driver = webdriver.Chrome(
            "C:/Users/Admin/Downloads/Python class docs/chromedriver_win32/chromedriver.exe"
        )

    # driver.get("https://www.thetestingworld.com/testings/")
    driver.get(ConfigReader.readConfigData('Details', 'Application_URL'))
    driver.maximize_window()
    return driver
def startBrowser():
    global driver

    if (ConfigReader.readConfigData('Details', 'BROWSER') == "chrome"):
        path = "./Driver/chromedriver.exe"
        driver = Chrome(executable_path=path)
        driver.get(ConfigReader.readConfigData('Details', 'URL'))
        driver.maximize_window()
        return driver

    elif (ConfigReader.readConfigData('Details', 'BROWSER') == "firefox"):
        path = "./Driver/geckodriver.exe"
        driver = Firefox(executable_path=path)
        driver.maximize_window()
        driver.get(ConfigReader.readConfigData('Details', 'URL'))
        return driver
    else:
        path = "./Driver/chromedriver.exe"
        driver = Chrome(executable_path=path)
        driver.get(ConfigReader.readConfigData('Details', 'URL'))
        driver.maximize_window()
        return driver
Exemple #13
0
def startBrowser():
    global driver
    options = webdriver.ChromeOptions()
    options.add_argument("--ignore-certificate-errors")
    #if ((ConfigReader.readConfigData("Details","driver"))=="chrome"):
    #path="C:\\Users\\meifute\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe"
    path = "../Driver/chromedriver.exe"
    driver = webdriver.Chrome(options=options, executable_path=path)
    #driver=webdriver.Chrome(executable_path=path)
    #elif ((ConfigReader.readConfigData("Details","driver"))=="firefox"):
    ## path = "C:\\Users\\meifute\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe"
    #driver = webdriver.Chrome(executable_path=path)
    driver.get(ConfigReader.readConfigData("Details", "Application_url"))
    driver.maximize_window()
    return driver
Exemple #14
0
from bs4 import BeautifulSoup
import requests
import csv
import time
from selenium.webdriver import Chrome
from Base import Initiate_Driver
from Library import ConfigReader

genre_length = ConfigReader.readConfigData('Details', 'genre_num')
filename = "../output/Movies_Data.csv"
csv_file = open(filename, 'w', newline='')
csv_writer = csv.writer(csv_file)
csv_writer.writerow([
    'name', 'from', 'to', 'rating', 'Tv/Movie', 'Country Name',
    'Time Duration', 'Genre', 'votes', 'reviews', 'Meta Score', 'Certificate',
    'critics', 'creators', 'stars'
])
genres = []
dict_pages = dict()
print("length of genre is ")
print(genre_length)
for i in range(int(genre_length)):
    gen = "genre" + str(i)
    genres.append(ConfigReader.readConfigData('Genre', gen))
# we are taking advantage of the url to get different types of content
print(genres)

for genre in genres:

    #creating their respective files to store data
    links = []