report.html

Report generated on 15-Nov-2022 at 19:31:56 by pytest-html v2.1.1

Environment

Packages {"pluggy": "0.13.1", "py": "1.9.0", "pytest": "6.1.0"}
Platform Windows-10-10.0.19041-SP0
Plugins {"allure-pytest": "2.8.18", "datadir": "1.3.1", "html": "2.1.1", "metadata": "1.10.0"}
Python 3.8.5

Summary

3 tests ran in 384.19 seconds.

0 passed, 0 skipped, 3 failed, 0 errors, 0 expected failures, 0 unexpected passes

Results

Result Test Duration Links
Failed test_frs_lead_prod.py::TestFrsLeadSubmission::test_ebook_lead_submission 9.84
self = <test_frs_lead_prod.TestFrsLeadSubmission object at 0x000001BC1F3001C0>, initialize_pages = None
testdata = {'db_type': 'mysql', 'query_to_fetch_urls': "select * from ice9.seo where linkable_type='ebook' and status=1 limit 10"}

@pytest.mark.test_details("0000","high","ebook lead","pallavi")
def test_ebook_lead_submission(self,initialize_pages,testdata):
self._test_add_rows_in_csv()
countervalue=0
query_to_get_data = db.get_prod_data(testdata['query_to_fetch_urls'],testdata['db_type'])
urls = list(map(itemgetter('url'), query_to_get_data))
for url in urls:
course =url.split('/')[-1]
ebook_url=(pytest.config['prod_url']+url).replace('//','/')
pytest.driver.get(ebook_url)
selenium_helper.scroll_page("100")
> counter,status,email=self.pg_ebook.submit_ebook_lead_submission(url)

test_prod\test_frs_lead_prod.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pages.ebook_page.EbookPage object at 0x000001BC1F4512E0>, testdata = '/crack-prince2-in-7-days-guide-pdf'

def submit_ebook_lead_submission(self, testdata):
counter=0
try:
self.locators = self.load_locators()
length = len(self.locators["button_download_now"])
for i in range(0,length):
if selenium_helper.is_element_clickable(self.locators["button_download_now"][i], 5)== False:
message='CTA not available'
else:
time.sleep(1)
self.button_download_now.scroll_to_element()
time.sleep(3)
self.button_download_now.click_button()
time.sleep(1)
self.input_ebook_email.clear_text()
time.sleep(2)
email= "SimpliAutoTesting" + str(random.randint(1,10000)) + "@simplilearn.com"
print(email)
self.input_ebook_email.set_text(email)
time.sleep(3)
self.input_phone.clear_text()
time.sleep(1)
self.input_phone.clear_text()
time.sleep(1)
self.input_phone.set_text('99999999')
self.button_form_cta.click_button()
time.sleep(2)
success_msg=self.form_success_message.get_text()
message='Lead submitted successfully'
break
except:
message='Lead submission failed'
counter=counter+1
> return counter,message,email
E UnboundLocalError: local variable 'email' referenced before assignment

pages\ebook_page.py:163: UnboundLocalError
Failed test_frs_lead_prod.py::TestFrsLeadSubmission::test_on_demand_webinar_lead_submission 357.62
self = <test_frs_lead_prod.TestFrsLeadSubmission object at 0x000001BC1CE1D7C0>, initialize_pages = None
testdata = {'collection_name': 'contents', 'database_name': 'caldon_automation', 'db_type': 'mysql', 'query_type': 'find_with_limit'}

@pytest.mark.test_details("0000","high","ebook lead","pallavi")
def test_on_demand_webinar_lead_submission(self,initialize_pages,testdata):
self._test_add_rows_in_csv()
countervalue=0
#STEP 2: set the mongo query
query = {}
query['database_name'] = testdata['database_name']
query['collection_name'] = testdata['collection_name']
query['query_type'] = testdata['query_type']
query['query'] ={'is_webcast':True, 'status':4}
query['limit']=10
query['project'] ={'seo_url':1}
response_data = db.get_test_data(query, 'mongo')
for url in response_data:
seo_url=url['seo_url']
course =seo_url.split('/')[-1]
on_demand_webinar=(pytest.config['prod_url']+seo_url)
pytest.driver.get(on_demand_webinar)
selenium_helper.scroll_page("200")
time.sleep(2)
counter,status=self.on_demand_webinar.on_demand_leads(url)
if counter >=1:
countervalue= countervalue+1
lead_type='FrsOndemandWebinar'
filename = "Report.csv"
rows = [[lead_type,course,on_demand_webinar,status]]
with open(filename, 'a', newline='\n') as csvfile:
csvwriter = csv.writer(csvfile)
csvwriter.writerows(rows)
if countervalue >=1:
> pytest.fail('lead submission failed')
E Failed: lead submission failed

test_prod\test_frs_lead_prod.py:88: Failed
-------------------------------Captured log call--------------------------------
ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/aws-security-identity-and-access-management-iam-webinar is not visible WARNING  setup:page_factory.py:53 the locator success_msg_webinar on url https://www.simplilearn.com/aws-security-identity-and-access-management-iam-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/how-to-mint-money-with-adsense-and-blogging-skills-webinar is not visible WARNING  setup:page_factory.py:53 the locator success_msg_webinar on url https://www.simplilearn.com/how-to-mint-money-with-adsense-and-blogging-skills-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/why-you-should-consider-career-in-salesforce-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/how-i-failed-my-pmp-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/need-for-cloud-skilled-technical-professionals-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/designing-spam-classifier-using-machine-learning-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/how-it-service-continuity-model-help-defeat-ransomware-attack-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/need-of-cyber-security-in-the-present-era-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/big-data-analysis-using-apache-hive-webinar is not visible ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com/basics-of-online-reputation-management-webinar is not visible
Failed test_frs_lead_prod.py::TestFrsLeadSubmission::test_live_webinar_lead_submission 6.29
self = <test_frs_lead_prod.TestFrsLeadSubmission object at 0x000001BC1F539D00>, initialize_pages = None
testdata = {'collection_name': 'contents', 'database_name': 'caldon_automation', 'db_type': 'mysql', 'query_type': 'find'}

@pytest.mark.test_details("0000","high","ebook lead","pallavi")
def test_live_webinar_lead_submission(self,initialize_pages,testdata):
countervalue=0
"""
#STEP 2: set the mongo query
query = {}
query['database_name'] = testdata['database_name']
query['collection_name'] = testdata['collection_name']
query['query_type'] = testdata['query_type']
query['query'] ={'is_webcast' :{'$ne': True },'type':'webinar','status':4}
query['project'] ={'seo_url':1}
response_data = db.get_test_data(query, 'mongo')
today_date=datetime.today().strftime('%Y-%m-%d')
print(today_date)
"""
response_data=['/program-preview-a-live-look-at-the-purdue-digital-marketing-bootcamp-webinar']
for url in response_data:
course =url.split('/')[-1]
live_webinar=pytest.config['prod_url']+url
#print(live_webinar)
pytest.driver.get(live_webinar)
selenium_helper.scroll_page("100")
> counter,status=self.live_webinar.live_webinar_lead_submission(url)
E ValueError: too many values to unpack (expected 2)

test_prod\test_frs_lead_prod.py:113: ValueError
-------------------------------Captured log call--------------------------------
ERROR  setup:selenium_helper.py:113 Message: WARNING  setup:selenium_helper.py:114 the locator ('xpath', "//a[contains(text(),'Register for webinar')]") on url https://www.simplilearn.com//program-preview-a-live-look-at-the-purdue-digital-marketing-bootcamp-webinar is not visible