How To Delete A Row In Excel Sheet Using Python? - python

I am working on a Selenium program using Python where I want to delete a row in the Excel sheet using Openpyxl library. The issue is I don't know how to implement the delete function in my program. Below here have 2 classes, AutoTest.py which is the testing class and NewCard.py which is the class where I implemented POM(Page Object Model). May I know how to implement the function to delete just 1 row in accordance with my program?
AutoTest.py
import unittest
import HtmlTestRunner
from selenium import webdriver
import openpyxl
import sys
sys.path.append("C:\Users\lukegoh\Desktop\Python Projects\SoftwareAutomationTesting")
from pageObjects.LoginPage import LoginPage
from pageObjects.HomePage import Homepage
from pageObjects.NewCard import NewCard
excpath = r"C:\Users\lukegoh\Desktop\Python Projects\SoftwareAutomationTesting\excel\new\ABT0475EC Card Init Detailed Rpt Test 01 - v13_1.xlsx"
excsheetName = "ABT0475EC Card Initialization D"
class AutoTest(unittest.TestCase):
baseURL = "https://10.2.5.215:33000/viewTopUpRequest"
username = "ezltest2svc"
password = "Password123!"
driver = webdriver.Chrome()
#classmethod
def setUpClass(cls):
cls.driver.get(cls.baseURL)
cls.driver.maximize_window()
cls.driver.implicitly_wait(10)
def test_1(self): #This is scenario 1- to create request for new card
lp = LoginPage(self.driver)
hp = Homepage(self.driver)
np = NewCard(self.driver)
lp.setUsername(self.username)
lp.setPassword(self.password)
lp.clickLogin()
hp.clickutil()
hp.clickreqNewCard()
np.setJobOrder()
np.clickExcel()
np.setTopUpAmount()
np.calculateAmount()
if not np.clickSubmit():
np.deleteRow(excpath,excsheetName,3)
else:
print("Test Passed")
# #classmethod
# def tearDownClass(cls):
# cls.driver.close()
# print("Test Completed")
#if __name__ == '__main__':
# unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output='C:/Users/lukegoh/Desktop/Python Projects/SoftwareAutomationTesting/reports'))
NewCard.py
import openpyxl
class NewCard:
jobOrder_xpath="//body/div[#id='wrapper']/div[3]/div[1]/div[1]/div[1]/div[1]/input[1]"
excelButton_xpath="//input[#id='img']"
topup_textbox_xpath="//input[#id='input-live']"
calculateAmount_xpath="(//button[#type='button'])[4]"
buttonSubmit_xpath="(//button[#type='button'])[5]"
def __init__(self,driver):
self.driver=driver
def setJobOrder(self):
self.driver.find_element_by_xpath(self.jobOrder_xpath).send_keys("AutoTest1")
def clickExcel(self):
self.driver.find_element_by_xpath(self.excelButton_xpath).send_keys(r"C:\Users\lukegoh\Desktop\Python Projects\SoftwareAutomationTesting\excel\new\ABT0475EC Card Init Detailed Rpt Test 01 - v13_1.xlsx")
def setTopUpAmount(self):
self.driver.find_element_by_xpath(self.topup_textbox_xpath).send_keys("10")
def calculateAmount(self):
self.driver.find_element_by_xpath(self.calculateAmount_xpath).click()
def clickSubmit(self):
self.driver.find_element_by_xpath(self.buttonSubmit_xpath).click()
def deleteRow(file, sheetName, rownum):
workbook = openpyxl.load_workbook(file)
sheet = workbook.get_sheet_by_name(sheetName)
sheet.cell(row=rownum).
workbook.save(file)

If you check OpenPyXL docs, it has something called delete_rows()
Syntax delete_rows(idx, amount=1), it deletes from idx and goes on deleting for amount
import openpyxl
filename = "example.xlsx"
wb = openpyxl.load_workbook(filename)
sheet = wb['Sheet1']
sheet.delete_rows(row_number, 1)
wb.save(filename)
Docs for delete_rows(): https://openpyxl.readthedocs.io/en/stable/api/openpyxl.worksheet.worksheet.html#openpyxl.worksheet.worksheet.Worksheet.delete_rows

use pandas
import pandas as pd
df = pd.read_excel("test.xlsx")
df = df.drop(df.index[1])
df.to_excel('test1.xlsx')

Related

Unable to successfully patch functions of Azure ContainerClient

I have been trying to patch the list_blobs() function of ContainerClient, have not been able to do this successfully, this code outputs a MagicMock() function - but the function isn't patched as I would expect it to be (Trying to patch with a list ['Blob1', 'Blob2'].
#################Script File
import sys
from datetime import datetime, timedelta
import pyspark
import pytz
import yaml
# from azure.storage.blob import BlobServiceClient, ContainerClient
from pyspark.dbutils import DBUtils as dbutils
import azure.storage.blob
# Open Config
def main():
spark_context = pyspark.SparkContext.getOrCreate()
spark_context.addFile(sys.argv[1])
stream = None
stream = open(sys.argv[1], "r")
config = yaml.load(stream, Loader=yaml.FullLoader)
stream.close()
account_key = dbutils.secrets.get(scope=config["Secrets"]["Scope"], key=config["Secrets"]["Key Name"])
target_container = config["Storage Configuration"]["Container"]
target_account = config["Storage Configuration"]["Account"]
days_history_to_keep = config["Storage Configuration"]["Days History To Keep"]
connection_string = (
"DefaultEndpointsProtocol=https;AccountName="
+ target_account
+ ";AccountKey="
+ account_key
+ ";EndpointSuffix=core.windows.net"
)
blob_service_client: azure.storage.blob.BlobServiceClient = (
azure.storage.blob.BlobServiceClient.from_connection_string(connection_string)
)
container_client: azure.storage.blob.ContainerClient = (
blob_service_client.get_container_client(target_container)
)
blobs = container_client.list_blobs()
print(blobs)
print(blobs)
utc = pytz.UTC
delete_before_date = utc.localize(
datetime.today() - timedelta(days=days_history_to_keep)
)
for blob in blobs:
if blob.creation_time < delete_before_date:
print("Deleting Blob: " + blob.name)
container_client.delete_blob(blob, delete_snapshots="include")
if __name__ == "__main__":
main()
#################Test File
import unittest
from unittest import mock
import DeleteOldBlobs
class DeleteBlobsTest(unittest.TestCase):
def setUp(self):
pass
#mock.patch("DeleteOldBlobs.azure.storage.blob.ContainerClient")
#mock.patch("DeleteOldBlobs.azure.storage.blob.BlobServiceClient")
#mock.patch("DeleteOldBlobs.dbutils")
#mock.patch("DeleteOldBlobs.sys")
#mock.patch('DeleteOldBlobs.pyspark')
def test_main(self, mock_pyspark, mock_sys, mock_dbutils, mock_blobserviceclient, mock_containerclient):
# mock setup
config_file = "Delete_Old_Blobs_UnitTest.yml"
mock_sys.argv = ["unused_arg", config_file]
mock_dbutils.secrets.get.return_value = "A Secret"
mock_containerclient.list_blobs.return_value = ["ablob1", "ablob2"]
# execute test
DeleteOldBlobs.main()
# TODO assert actions taken
# mock_sys.argv.__get__.assert_called_with()
# dbutils.secrets.get(scope=config['Secrets']['Scope'], key=config['Secrets']['Key Name'])
if __name__ == "__main__":
unittest.main()
Output:
<MagicMock name='BlobServiceClient.from_connection_string().get_container_client().list_blobs()' id='1143355577232'>
What am I doing incorrectly here?
I'm not able to execute your code in this moment, but I have tried to simulate it. To do this I have created the following 3 files in the path: /<path-to>/pkg/sub_pkg1 (where pkg and sub_pkg1 are packages).
File ContainerClient.py
def list_blobs(self):
return "blob1"
File DeleteOldBlobs.py
from pkg.sub_pkg1 import ContainerClient
# Open Config
def main():
blobs = ContainerClient.list_blobs()
print(blobs)
print(blobs)
File DeleteBlobsTest.py
import unittest
from unittest import mock
from pkg.sub_pkg1 import DeleteOldBlobs
class DeleteBlobsTest(unittest.TestCase):
def setUp(self):
pass
def test_main(self):
mock_containerclient = mock.MagicMock()
with mock.patch("DeleteOldBlobs.ContainerClient.list_blobs", mock_containerclient.list_blobs):
mock_containerclient.list_blobs.return_value = ["ablob1", "ablob2"]
DeleteOldBlobs.main()
if __name__ == '__main__':
unittest.main()
If you execute the test code you obtain the output:
['ablob1', 'ablob2']
['ablob1', 'ablob2']
This output means that the function list_blobs() is mocked by mock_containerclient.list_blobs.
I don't know if the content of this post can be useful for you, but I'm not able to simulate better your code in this moment.
I hope you can inspire to my code to find your real solution.
The structure of the answer didn't match my solution, perhaps both will work but it was important for me to patch pyspark even though i never call it, or exceptions would get thrown when my code tried to interact with spark.
Perhaps this will be useful to someone:
#mock.patch("DeleteOldBlobs.azure.storage.blob.BlobServiceClient")
#mock.patch("DeleteOldBlobs.dbutils")
#mock.patch("DeleteOldBlobs.sys")
#mock.patch('DeleteOldBlobs.pyspark')
def test_list_blobs_called_once(self, mock_pyspark, mock_sys, mock_dbutils, mock_blobserviceclient):
# mock setup
config_file = "Delete_Old_Blobs_UnitTest.yml"
mock_sys.argv = ["unused_arg", config_file]
account_key = 'Secret Key'
mock_dbutils.secrets.get.return_value = account_key
bsc_mock: mock.Mock = mock.Mock()
container_client_mock = mock.Mock()
blob1 = Blob('newblob', datetime.today())
blob2 = Blob('oldfile', datetime.today() - timedelta(days=20))
container_client_mock.list_blobs.return_value = [blob1, blob2]
bsc_mock.get_container_client.return_value = container_client_mock
mock_blobserviceclient.from_connection_string.return_value = bsc_mock
# execute test
DeleteOldBlobs.main()
#Assert Results
container_client_mock.list_blobs.assert_called_once()

Python Selenium Printing Save-As-PDF Waiting for Filename Input

I'm trying to save a website as PDF through printing dialog. My code allows me to save as pdf, but asks me to input a filename, which I don't know how to pass a filename to the pop up box.
Attached is my code:
import time
from selenium import webdriver
import os
class printing_browser(object):
def __init__(self):
self.profile = webdriver.FirefoxProfile()
self.profile.set_preference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", False)
self.profile.set_preference("pdfjs.disabled", True)
self.profile.set_preference("print.always_print_silent", True)
self.profile.set_preference("print.show_print_progress", False)
self.profile.set_preference("browser.download.show_plugins_in_list",False)
foxdriver = r'C:\Users\AShen\Documents\Workspace\geckodriver.exe'
self.driver = webdriver.Firefox(executable_path=foxdriver,firefox_profile = self.profile)
time.sleep(5)
def get_page_and_print(self, page):
self.driver.get(page)
time.sleep(5)
self.driver.execute_script("window.print();")
if __name__ == "__main__":
browser_that_prints = printing_browser()
browser_that_prints.get_page_and_print('http://www.google.com/')
These days I had the same question.
I solved it without using the pyautogui in these case, because I use different PCs and monitors and I didn't want to depend on the position of the click.
I was able to solve it using the about:config... changing them with each necessary print (in PDF).
The name of my printer "in PDF" in Ubuntu is "Print to File" (defined in print_printer) and the settings of about:config need to be this printer...
For example: print.printer_Print_to_File.print_to_file: true
import os
import time
from selenium import webdriver
class printing_browser(object):
def __init__(self):
self.profile = webdriver.FirefoxProfile()
self.profile.set_preference('services.sync.prefs.sync.browser.download.manager.showWhenStarting', False)
self.profile.set_preference('pdfjs.disabled', True)
self.profile.set_preference('print.always_print_silent', True)
self.profile.set_preference('print.show_print_progress', False)
self.profile.set_preference('browser.download.show_plugins_in_list', False)
self.profile.set_preference('browser.download.folderList', 2)
self.profile.set_preference('browser.download.dir', '')
self.profile.set_preference('browser.download.manager.showWhenStarting', False)
self.profile.set_preference('browser.aboutConfig.showWarning', False)
self.profile.set_preference('print.print_headerright', '')
self.profile.set_preference('print.print_headercenter', '')
self.profile.set_preference('print.print_headerleft', '')
self.profile.set_preference('print.print_footerright', '')
self.profile.set_preference('print.print_footercenter', '')
self.profile.set_preference('print.print_footerleft', '')
self.profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'application/octet-stream;application/vnd.ms-excel;text/html')
foxdriver = r'C:\Users\AShen\Documents\Workspace\geckodriver.exe'
self.driver = webdriver.Firefox(
executable_path=foxdriver,
firefox_profile=self.profile
)
time.sleep(1)
def get_page_and_print(self, page, filepath):
# Get about:config
self.driver.get('about:config')
time.sleep(1)
# Define Configurations
script = """
var prefs = Components.classes['#mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref('print.always_print_silent', true);
prefs.setCharPref('print_printer', 'Print to File');
prefs.setBoolPref('print.printer_Print_to_File.print_to_file', true);
prefs.setCharPref('print.printer_Print_to_File.print_to_filename', '{}');
prefs.setBoolPref('print.printer_Print_to_File.show_print_progress', true);
""".format(filepath)
# Set Configurations
self.driver.execute_script(script)
time.sleep(1)
# Get site to print in pdf
self.driver.get(page)
time.sleep(2)
self.driver.execute_script("window.print();")
browser_that_prints = printing_browser()
browser_that_prints.get_page_and_print('http://www.google.com', os.path.join(os.getcwd(), 'mywebpage.pdf'))
Oh, it is very easy if you know about pyautogui.
This is an amazing module that allows you to automate your curser.
So essentially, you need to figure out the place where the popup appears and use pyautogui to click it for you.
All you need to add is:
time.sleep(3)
i=random.randint(0,1000)
file_name=('name_pdf '+str(i))
print (file_name)
pyautogui.typewrite(file_name)
pyautogui.click(512,449)
Entire code structure will look like this:
import time
import pyautogui
from selenium import webdriver
import os
class printing_browser(object):
def __init__(self):
self.profile = webdriver.FirefoxProfile()
self.profile.set_preference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", False)
self.profile.set_preference("pdfjs.disabled", True)
self.profile.set_preference("print.always_print_silent", True)
self.profile.set_preference("print.show_print_progress", False)
self.profile.set_preference("browser.download.show_plugins_in_list",False)
foxdriver = r'C:\Users\Pranjal Pathak\Desktop\Titanic Kaggle\geckodriver.exe'
self.driver = webdriver.Firefox(executable_path=foxdriver,firefox_profile = self.profile)
time.sleep(5)
def get_page_and_print(self, page):
self.driver.get(page)
time.sleep(5)
self.driver.execute_script("window.print();")
if __name__ == "__main__":
browser_that_prints = printing_browser()
browser_that_prints.get_page_and_print('http://www.python.org/')
time.sleep(3)
i=random.randint(0,1000)
file_name=('name_pdf '+str(i))
print (file_name)
pyautogui.typewrite(file_name)
pyautogui.click(512,449)
Note: 1. I have selected the name of the file as name+any random integer between 1 to 1000 to change name every time you save the file. This way it will save every time you run the code as the names will be different every time.
If this types the name but does not save the file, you might want to change the coordinates of your curser. Let me know if that happens.

django time checker database

I am trying to create a thread function that allow me to check a database field in order to see if the time.now() is bigger than the one recorded in the database(postgresql); the problem is that the view.py where I am calling this, is blocked by this thread, this is my actual code:
PD: expire_pet is a text field, then I cast it to datetime.
import socket
import struct
from time import *
from datetime import datetime
from models import Zone
from multiprocessing import pool
import threading
class ControlHora(threading.Thread):
def __init__(self,zone_id):
threading.Thread.__init__(self)
self.zone_id = zone_id
def run(self):
while(True):
zone_pet = Zone.objects.filter(id = self.zone_id)
for i in zone_pet:
if i.pet_state == True:
hour = datetime.datetime.strptime(i.expire_pet, '%I:%M')
if hour <= datetime.datetime.now():
Zone.objects.filter(id = self.zone_id).update(vitrasa_pet = False)
Zone.objects.filter(id = self.zone_id).update(esycsa_pet = False)
Zone.objects.filter(id = self.zone_id).update(pet_state = False)
Zone.objects.filter(id = self.zone_id).update(expire_pet='')
sleep(5)
It works, the problem was that I have been calling the run in the wrong place, thanks

Copy cell value and paste into search box

I'm trying to design an automation process that reads the value of a cell in an excel document, copies the value into a variable, and that variable is is pasted into a search box on a site. When the process is called again it goes to the next line, gets the new cell value, and searches again. However I can't seem to get it right in the slightest!
*Edit 7/21/2016
My current problem now is that on every iteration of the code the previous cell and new cell values are pasted. For example the first cell is 42-7211 and the second cell is 45-7311 and on the next time the function is called it pastes " 42-721145-7311 " not "45-7311"
Here is my full updated code. Once i get to the proper screen I use the function
prod_choose_searchbar to paste and then call stp to go to the next cell.
My Code UPDATED
import unittest
import xlrd
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium import *
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
from datetime import date
from datetime import timedelta
import time
from time import sleep
def yesterday():
# Get today.
today = date.today()
# Subtract timedelta of 1 day.
yesterday = today - timedelta(days=1)
return yesterday
import logging
#start logging module this will record all actions and record them for debugging purposes!
LOG_FILENAME = 'log_file_selenium.txt'
logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG)
logging.debug('This message should go to the log file')
#clear window
os.system('cls')
#open EXCEL
#Start classes
#define variables to call for automation process
#this will help run faster so the code is shorter in the main sections
"""
Used to read cells from an excel file one at a time
Use:
1) Call the class with new()
2) Call new.var() to clear variables and start at top of document
3) Call new.stp() to begin process
4) Call new.nextp() until finished
"""
#########################################################################
#########################################################################
class calls_sms():
def __init__(self): #sets variables up and inital value NULL
self.w = None
self.variable = None
self.value = None
self.default_int = 0 #
self.default_string = None #These are for empty feilds
self.default = None #
#open EXCEL
self.file_location = "C:\\Users\\doarni\\Desktop\\T0088Transfer.xls"
self.workbook = xlrd.open_workbook(self.file_location)
self.sheet = self.workbook.sheet_by_index(0)
#Excel interaction
def beginprod(self):
self.w = 1
calls_sms.stp(self)
def stp(self):
for row in range(self.sheet.nrows):
row = self.sheet.row_values(self.w)
self.variable = None
self.variable = row[7]
self.w += 1
return row[7]
#abbreviations for later use
def var(self): #must be called var, driver is not defined till launch call
self.xpath = self.driver.find_element_by_xpath
self.classname = self.driver.find_element_by_class_name
self.css = self.driver.find_element_by_css_selector
self.actions = ActionChains(self.driver)
#Open IE driver and new IE window
def launch(self):
self.driver = webdriver.Ie()
self.driver.get("https://www.mywebsite.com/")
logging.debug('Connected to SMS on '+str(date.today())+'')
def login(self):
self.username = self.classname("GJCH5BMD1C")
self.password = self.xpath("//*[#type='password']")
try:
self.username.send_keys("username")
self.password.send_keys("password")
self.log_in = self.xpath("//*[#class='GJCH5BMI-C']").click()
except:
os.system('python sms_generic_err.py')
logging.debug('FAILED LOGIN'+str(date.today())+'')
#Stock tab
def stock_tab(self):
#Only call when on stock tab
self.stock = self.xpath("//div[#class='GJCH5BMHEF' and text()=' Stock ']").click()
time.sleep(0.2)
def stock_tab_prd_select(self):
#opens prod chooser
self.stockselect = self.xpath("//span[#class='GJCH5BMKU' and text()='Select']").click()
def stock_searchbtn(self):
self.stocksearch = self.xpath("//*[#class='GJCH5BMJV']")
self.stocksearch.click()
def stock_tab_prd_clear(self):
#clears product
self.stockclear = self.xpath("//span[#class='GJCH5BMKU' and text()='Clear']").click()
def stock_resetbtn(self):
#stock reset button
self.stockreset = self.xpath("//span[#class='GJCH5BMKU' and text()='Reset']").click()
#Product Chooser
def prod_choose_searchbar(self):
#finds the searchbox and clicks
self.search = self.css(".GJCH5BMASD")
self.search.click()
print('paste value: '+str(self.variable))
#pastes in prod number from variable
self.clicksearch = self.actions.move_to_element(self.search).send_keys(calls_sms.stp(self)).perform()
print('paste value after: '+str(self.variable))
def prod_choose_clicksearch(self):
self.clicksearch = self.xpath("//*[#class='GJCH5BMPR']").click()
def prod_choose_clickadd(self):
self.clickadd = self.css(".GJCH5BMCHI").click()
def prod_choose_clickfinish(self):
self.clickfinish = self.xpath("//div[#class='GJCH5BMJYC GJCH5BMGYC' and text()='Finish']").click()
#these must be called manually in the script not through the class
def user_ask_invtab():
os.system('python sms_err_select_inv.py')
def user_ask_ciinsight():
os.system('python sms_err_select_ciinsight.py')
if __name__ == "__main__":
unittest.main()
#########################################################################
#########################################################################
#Check Territory
#NEEDS TO BE FIXED LATER!
#this will most likely be built in another module
class territory_check():
def check_exists_ci__by_xpath():
try:
webdriver.find_element_by_xpath("//*[#class='GJCH5BMOW']")
except NoSuchElementException:
return False
os.system("python sms_connected_ci.py")
return True
#########################################################################
#########################################################################
SMS = calls_sms()
#%#%#%#%#%#%#%#%#%#%#%#%
SMS.launch()
SMS.var()
SMS.login()
os.system('python sms_err_select_inv.py')
time.sleep(2)
SMS.stock_tab()
time.sleep(2)
SMS.beginprod()
SMS.stock_tab_prd_select()
time.sleep(1)
SMS.prod_choose_searchbar()
time.sleep(2)
SMS.prod_choose_clickfinish()
time.sleep(2)
SMS.stock_tab_prd_select()
time.sleep(1)
SMS.prod_choose_searchbar()
time.sleep(2)
SMS.prod_choose_clickfinish()
time.sleep(1)
SMS.stock_tab_prd_select()
time.sleep(1)
SMS.prod_choose_searchbar()
time.sleep(2)
SMS.prod_choose_clickfinish()
I want it to read the excel file, grab the value from the cell, paste it into send_keys. and then be able to call another function to move to the next cell below and loop only when called.
I figured it out finally. I have to update the actions variable or else the strings are stored in it each time. will post solution soon once its written

How to call a function from another class in python->sikuli?

How can i access methods of channel1 in channel2 so that test_script1,test_script2 is execute first and then test_script3,test_script4.
Note:- The main issue is when i am executing
suite1= unittest.TestLoader().loadTestsFromTestCase(channel1) and
suite2= unittest.TestLoader().loadTestsFromTestCase(channel2), i am getting two reprort tables.
But instead i want them to merge in one table consisting data of channel1 and channel2 classes both.
from sikuli import *
import unittest
import HTMLTestRunner
class channel1(unittest.TestCase):
def test_script1(self):
assert exists("1453186120180.png")
def test_script2(self):
assert exists("1453186901719.png")
class channel2(unittest.TestCase):
def test_script3(self):
assert exists("1453186120180.png")
def test_script4(self):
assert exists("1453186901719.png")
#channel2().test_script1()
#suite1 = unittest.TestLoader().loadTestsFromTestCase(_main_channel.channel1)
#ch1=channel1.test_script1()
#ch2=channel1.test_script2()
suite2= unittest.TestLoader().loadTestsFromTestCase(channel2)
#suite2 = unittest.TestLoader().loadTestsFromTestCase(obj2)
outfile = open("D:\\report.html", "wb") # path to report folder
#runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' ).run(suite1)
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' ).run(suite1)
#runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' ).run(suite2)
#runner.run(suite2)
Please help..

Categories