report.html

Report generated on 23-Feb-2023 at 09:17:46 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

77 tests ran in 1061.41 seconds.

(Un)check the boxes to filter the results.

75 passed, 0 skipped, 2 failed, 0 errors, 0 expected failures, 0 unexpected passes

Results

Show all details / Hide all details

vvv
Result
vvv
Test
vvv
Duration
Links
Failed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Instagram] 21.84
self = <test_SL_footer_check.TestSLFooterCheck object at 0x0000027719CFE940>, value = 'Instagram'
initialize_pages = None

@pytest.mark.test_details("SLUB-T0000","high","Sl Footer Check","Pradeep")
@pytest.mark.parametrize("value",_create_parameterised_data())
def test_SL_Footer_check(self,value,initialize_pages):
try:
logging.info(value)
with open('sl_footer_check_test_data.csv', 'r') as csv_file:
csv_data = csv.reader(csv_file)
for line in csv_data:
if line[0] == value:
url = line[1]
logging.info(f"URL for {value} is : {url}")
break

pytest.driver.get(pytest.config['prod_url'])
selenium_helper.wait_for_page_to_load(20,pytest.config['prod_url'])
dynamic_locator = f"(//div[starts-with(@class,'col-md-2')]//a[@title='{value}'])[1]"
logging.info(f"Dynamic Locator : {dynamic_locator}")
time.sleep(3)
WebDriverWait(pytest.driver, 20).until(EC.element_to_be_clickable((By.XPATH, dynamic_locator))).scroll_to_element()
time.sleep(2)
default_window = pytest.driver.current_window_handle
pytest.driver.find_element(By.XPATH,dynamic_locator).click()
time.sleep(5)
window_handle = list(pytest.driver.window_handles)
if len(window_handle) > 1:
pytest.driver.close()
pytest.driver.switch_to.window(window_handle[-1])

url_opened,message = self.check_redirection(value,url)
rows = [[value,url,url_opened,message]]
with open("Report.csv", 'a', newline='\n') as csvfile:
csvwriter = csv.writer(csvfile)
csvwriter.writerows(rows)
if 'Not Working' in message:
pytest.driver.get_screenshot_as_file(os.path.join(os.path.dirname(os.curdir), "report\screenshot", f"{__name__}_{value}.jpeg"))
> pytest.fail()

test_prod\test_SL_footer_check.py:261:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

msg = '', pytrace = True

@_with_exception(Failed)
def fail(msg: str = "", pytrace: bool = True) -> "NoReturn":
"""Explicitly fail an executing test with the given message.

:param str msg:
The message to show the user as reason for the failure.
:param bool pytrace:
If False, msg represents the full failure information and no
python traceback will be reported.
"""
__tracebackhide__ = True
> raise Failed(msg=msg, pytrace=pytrace)
E Failed: <Failed instance>

c:\users\qateam\appdata\local\programs\python\python38\lib\site-packages\_pytest\outcomes.py:153: Failed

During handling of the above exception, another exception occurred:

self = <test_SL_footer_check.TestSLFooterCheck object at 0x0000027719CFE940>, value = 'Instagram'
initialize_pages = None

@pytest.mark.test_details("SLUB-T0000","high","Sl Footer Check","Pradeep")
@pytest.mark.parametrize("value",_create_parameterised_data())
def test_SL_Footer_check(self,value,initialize_pages):
try:
logging.info(value)
with open('sl_footer_check_test_data.csv', 'r') as csv_file:
csv_data = csv.reader(csv_file)
for line in csv_data:
if line[0] == value:
url = line[1]
logging.info(f"URL for {value} is : {url}")
break

pytest.driver.get(pytest.config['prod_url'])
selenium_helper.wait_for_page_to_load(20,pytest.config['prod_url'])
dynamic_locator = f"(//div[starts-with(@class,'col-md-2')]//a[@title='{value}'])[1]"
logging.info(f"Dynamic Locator : {dynamic_locator}")
time.sleep(3)
WebDriverWait(pytest.driver, 20).until(EC.element_to_be_clickable((By.XPATH, dynamic_locator))).scroll_to_element()
time.sleep(2)
default_window = pytest.driver.current_window_handle
pytest.driver.find_element(By.XPATH,dynamic_locator).click()
time.sleep(5)
window_handle = list(pytest.driver.window_handles)
if len(window_handle) > 1:
pytest.driver.close()
pytest.driver.switch_to.window(window_handle[-1])

url_opened,message = self.check_redirection(value,url)
rows = [[value,url,url_opened,message]]
with open("Report.csv", 'a', newline='\n') as csvfile:
csvwriter = csv.writer(csvfile)
csvwriter.writerows(rows)
if 'Not Working' in message:
pytest.driver.get_screenshot_as_file(os.path.join(os.path.dirname(os.curdir), "report\screenshot", f"{__name__}_{value}.jpeg"))
pytest.fail()

except:
logging.info("Exception Occurred", exc_info=True)
pytest.driver.get_screenshot_as_file(os.path.join(os.path.dirname(os.curdir), "report\screenshot", f"{__name__}_{value}.jpeg"))
> pytest.fail()
E Failed: <Failed instance>

test_prod\test_SL_footer_check.py:266: Failed
-------------------------------Captured log call--------------------------------
INFO  setup:test_SL_footer_check.py:230 Instagram INFO  setup:test_SL_footer_check.py:236 URL for Instagram is : https://www.instagram.com/simplilearn_elearning/ INFO  setup:test_SL_footer_check.py:242 Dynamic Locator : (//div[starts-with(@class,'col-md-2')]//a[@title='Instagram'])[1] INFO  setup:test_SL_footer_check.py:84 URL received is : https://www.instagram.com/simplilearn_elearning/ INFO  setup:test_SL_footer_check.py:85 URL Opened is : https://www.instagram.com/simplilearn_elearning/ INFO  setup:test_SL_footer_check.py:264 Exception Occurred Traceback (most recent call last): File "C:\test_repos\pre_sales_test_python\test_prod\test_SL_footer_check.py", line 261, in test_SL_Footer_check pytest.fail() File "c:\users\qateam\appdata\local\programs\python\python38\lib\site-packages\_pytest\outcomes.py", line 153, in fail raise Failed(msg=msg, pytrace=pytrace) Failed: <Failed instance>
Failed test_SL_footer_check.py::TestSLFooterCheckTermsAndConditions::test_SL_Footer_check_terms_and_conditions 21.70
self = <test_SL_footer_check.TestSLFooterCheckTermsAndConditions object at 0x0000027719FAE040>, initialize_pages = None

@pytest.mark.test_details("SLUB-T0000","high","Sl Footer Check","Pradeep")
def test_SL_Footer_check_terms_and_conditions(self,initialize_pages):
self._remove_testdata_file()
try:
pytest.driver.get(pytest.config['prod_url'])
selenium_helper.wait_for_page_to_load(20,pytest.config['prod_url'])

selenium_helper.is_locator_present(self.pg_home.locators['terms_and_conditions'],15)
> self.pg_home.terms_and_conditions.scroll_to_element()

test_prod\test_SL_footer_check.py:953:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pages_prod.home_page.HomePage object at 0x000002771A0126D0>, loc = 'terms_and_conditions'

def __getattr__(self, loc):

logging.debug(f"the current locator to be found {loc} on url {self.driver.current_url}")
if loc in self.locators.keys():
error = ""
for loc_pair in self.locators[loc]:
loc_pair[0] = selenium_helper.TYPE_OF_LOCATORS[loc_pair[0].lower()]
loc_pair = tuple(loc_pair)
try:
element = WebDriverWait(self.driver, self.timeout).until(
EC.presence_of_element_located(loc_pair)
)
except (StaleElementReferenceException, NoSuchElementException, TimeoutException) as e:
error = e
#logging.warning(f"the locator {loc} on url {self.driver.current_url} is not present")
continue

try:
element = WebDriverWait(self.driver, self.timeout).until(
EC.visibility_of_element_located(loc_pair)
)
except (StaleElementReferenceException, NoSuchElementException, TimeoutException) as e:
error = e
logging.warning(f"the locator {loc} on url {self.driver.current_url} is not visible")
continue

element = self.get_web_element(*loc_pair)
element._locator = loc_pair
logging.debug(f"the locator {loc} is found!")
return element
> raise NoSuchElementException("An exception of type " + type(error).__name__ + " occurred. With Element -: " + loc)
E selenium.common.exceptions.NoSuchElementException: Message: An exception of type TimeoutException occurred. With Element -: terms_and_conditions

core\page_factory.py:60: NoSuchElementException

During handling of the above exception, another exception occurred:

self = <test_SL_footer_check.TestSLFooterCheckTermsAndConditions object at 0x0000027719FAE040>, initialize_pages = None

@pytest.mark.test_details("SLUB-T0000","high","Sl Footer Check","Pradeep")
def test_SL_Footer_check_terms_and_conditions(self,initialize_pages):
self._remove_testdata_file()
try:
pytest.driver.get(pytest.config['prod_url'])
selenium_helper.wait_for_page_to_load(20,pytest.config['prod_url'])

selenium_helper.is_locator_present(self.pg_home.locators['terms_and_conditions'],15)
self.pg_home.terms_and_conditions.scroll_to_element()
time.sleep(2)
self.pg_home.terms_and_conditions.click_button()
value = self.pg_home.terms_and_conditions.get_text()
url = self.pg_home.terms_and_conditions.get_attribute("href")
time.sleep(4)
window_handle = list(pytest.driver.window_handles)
if len(window_handle) > 1:
pytest.driver.close()
pytest.driver.switch_to.window(window_handle[-1])

selenium_helper.wait_for_page_to_load(20,url)
url_opened = pytest.driver.current_url
status=requests.head(url_opened).status_code
if url == url_opened and status == 200:
message = "Pass"
else:
message = f"{value} Link is Not Working"

rows = [[value,url,url_opened,message]]
with open("Report.csv", 'a', newline='\n') as csvfile:
csvwriter = csv.writer(csvfile)
csvwriter.writerows(rows)
if 'Not Working' in message:
pytest.driver.get_screenshot_as_file(os.path.join(os.path.dirname(os.curdir), "report\screenshot", f"{__name__}.jpeg"))
pytest.fail()

except:
logging.info("Exception Occurred", exc_info=True)
pytest.driver.get_screenshot_as_file(os.path.join(os.path.dirname(os.curdir), "report\screenshot", f"{__name__}.jpeg"))
> pytest.fail()
E Failed: <Failed instance>

test_prod\test_SL_footer_check.py:983: Failed
------------------------------Captured stdout call------------------------------
sl_footer_check_test_data.csv file deleted sl_footer_check_test_data_terms.csv file deleted sl_footer_check_test_data_trending_Courses.csv file deleted sl_footer_check_test_data_trending_MP.csv file deleted sl_footer_check_test_data_trending_PGP.csv file deleted sl_footer_check_test_data_trending_Resources.csv file deleted
-------------------------------Captured log call--------------------------------
INFO  setup:test_SL_footer_check.py:981 Exception Occurred Traceback (most recent call last): File "C:\test_repos\pre_sales_test_python\test_prod\test_SL_footer_check.py", line 953, in test_SL_Footer_check_terms_and_conditions self.pg_home.terms_and_conditions.scroll_to_element() File "C:\test_repos\pre_sales_test_python\core\page_factory.py", line 60, in __getattr__ raise NoSuchElementException("An exception of type " + type(error).__name__ + " occurred. With Element -: " + loc) selenium.common.exceptions.NoSuchElementException: Message: An exception of type TimeoutException occurred. With Element -: terms_and_conditions
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Refer and Earn] 14.21
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Facebook] 21.53
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Twitter] 21.56
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[YouTube] 17.66
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[LinkedIn] 11.88
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Telegram] 21.97
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[About us] 12.90
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Careers] 12.73
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[In the media] 32.74
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Alumni speak] 24.76
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Grievance redressal] 11.18
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Contact us] 11.08
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Become an instructor] 11.04
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Blog as guest] 10.86
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Skillup] 11.17
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Skillup Sitemap] 11.06
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Resources] 10.98
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[RSS feed] 10.80
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[City Sitemap] 11.12
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Corporate training] 10.79
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Partners] 11.40
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Digital Transformation] 12.78
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Get the Android App] 11.12
Passed test_SL_footer_check.py::TestSLFooterCheck::test_SL_Footer_check[Get the iOS App] 11.23
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Artificial Intelligence Course] 11.64
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Cloud Computing Certification Course] 10.91
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Full Stack Web Development Course] 10.84
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[PG in Data Science] 10.87
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[MS in Artificial Intelligence] 11.31
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Product Management Certification Course] 11.15
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Blockchain Course] 11.17
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Machine Learning Course] 11.27
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Cyber Security Course in India] 10.94
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Project Management Certification Course] 10.79
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Cyber Security Certification Course] 11.06
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Lean Six Sigma Certification Course] 11.07
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Advanced Certificate Program in Data Science] 11.33
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[Data Analytics Program] 11.02
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingPGP::test_SL_Footer_check_trending_PGP[AI and ML Course] 11.06
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[PMP Plus Certification Training Course] 11.14
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Data Science Certifiation Course] 10.91
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Data Analyst Course] 11.10
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Masters in Artificial Intelligence] 11.36
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Cloud Architect Certification Training Course] 10.98
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[DevOps Engineer Certification Training Course] 11.13
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Digital Marketing Course] 11.10
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Cyber Security Expert Course] 10.88
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[MEAN Stack Developer Course] 11.05
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingMP::test_SL_Footer_check_trending_MP[Business Analyst Course] 10.90
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[PMP Certification Training Course] 11.49
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[CSM Certification Course] 11.27
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Data Science with Python Course] 11.78
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Tableau Certification Course] 11.02
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Power BI Certification Course] 10.86
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[TOGAF Certification Course] 11.10
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[ITIL 4 Foundation Certification Training Course] 10.83
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[AWS Solutions Architect Certification Training Course] 11.17
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[CISSP Certification Training] 10.87
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Java Certification Course] 11.02
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Python Certification Training Course] 11.12
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingCourses::test_SL_Footer_check_trending_Courses[Big Data Hadoop Course] 11.37
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Python Tutorial] 12.13
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[JavaScript Tutorial] 12.30
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Java Tutorial] 11.96
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Angular Tutorial] 11.73
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Node.js Tutorial] 11.86
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Docker Tutorial] 11.61
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Git Tutorial] 11.65
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Kubernetes Tutorial] 11.78
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[Power BI Tutorial] 12.07
Passed test_SL_footer_check.py::TestSLFooterCheckTrendingResources::test_SL_Footer_check_trending_Resources[CSS Tutorial] 11.74
Passed test_SL_footer_check.py::TestSLFooterCheckTerms::test_SL_Footer_check_terms[Terms of Use] 17.32
Passed test_SL_footer_check.py::TestSLFooterCheckTerms::test_SL_Footer_check_terms[Privacy Policy] 16.59
Passed test_SL_footer_check.py::TestSLFooterCheckTerms::test_SL_Footer_check_terms[Refund Policy] 16.80
Passed test_SL_footer_check.py::TestSLFooterCheckTerms::test_SL_Footer_check_terms[Reschedule Policy] 16.92