Issue in data driven part 2 | Selenium Python Forum
T
Tias Basu Posted on 08/05/2023

Hello...

Here is my code runnung in pycharm but I am able to open chrome browser. Please suggest.

 

test_login.py

from testresource.applicationkeywords import applicationkeywords

app = applicationkeywords() #craete object

def test_login():
app.openbrowser('chrome')


generickeywords.py
from pyjavaproperties import Properties
#from selenium.webdriver.chrome import webdriver
from selenium import webdriver


class genkeyword:

def __init__(self):
pass
self.prop = Properties()
propertiesFile = open("C:\\Users\\tbasu\\PycharmProjects\\Project\\config.properties")
self.prop.load(propertiesFile)
self.prop.list()

def openbrowser(self,browsername):

if(browsername=='chrome'):

path = "C:\\chromedriver_win32\\chromedriver.exe"
self.driver = webdriver.Chrome(executable_path=path)
print("Open Browser")

applicationkeywords.py
from testresource.generickeywords import genkeyword
from testresource.validatekeywords import validatekeywords


class applicationkeywords(genkeyword,validatekeywords): #inherit the parent class
def login(self):
pass