Error: ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202
from datetime import datetime
# datetime object containing current date and time
now = datetime.now()
# dd/mm/YY H:M:S
dt_string = now.strftime("%d_%m_%Y_%H:%M:%S")
#print("date and time =", dt_string)
from selenium import webdriver
#import xlsxwriter
import xlwt
import time
from xlwt import easyxf
#from selenium.webdriver.chrome.options import Options
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
from selenium.webdriver.support.ui import Select
#Replace your NQID here
driver=webdriver.Chrome("C:\\Users\\SYSTEM\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe")
wb=xlwt.Workbook()
xlwt.add_palette_colour("custom_colour", 0x16)
wb.set_colour_RGB(0x16, 74, 150, 216)
xlwt.add_palette_colour('color_green', 0x14)
wb.set_colour_RGB(0x14, 135, 218, 93)
style2 = xlwt.easyxf('pattern: pattern solid, fore_colour red; border: left thin, top thin, right thin, left thin;font: name Arial, bold True;align: vert centre, horiz centre')
style1 = xlwt.easyxf('pattern: pattern solid, fore_colour color_green; border: left thin, top thin, right thin, left thin;font: name Trebuchet MS, bold True;align: vert centre, horiz centre')
style3 = xlwt.easyxf('pattern: pattern solid, fore_colour custom_colour; border: left thin, top thin, right thin, left thin;font: name Trebuchet MS, bold True;align: vert centre, horiz centre')
style4 = easyxf(' border: left thin, top thin, right thin, left thin')
#style = xlwt.easyxf('font: bold off, color black; borders: left thin, right thin, top thin, bottom thin; pattern: pattern solid, fore_color white;','font: bold off, color black; borders: left thin, right thin, top thin, bottom thin; pattern: pattern solid, fore_color white;')
sheet1=wb.add_sheet("Application Status Check")
sheet1.write(0,0,'ENDPOINT',style3)
sheet1.write(0,1,'APPLICATION',style3)
sheet1.write(0,2,'STATUS',style3)
sheet1.write(0,3,'REMARK',style3)
sheet1.write(0,4,'INCIDENT',style3)
#driver.get("https://someURL")
driver.get("https://someURL")
driver.find_element_by_id("details-button").click()
driver.find_element_by_id("proceed-link").click()
time.sleep(4)
driver.find_element_by_id("username").send_keys("userID")
driver.find_element_by_id("password").send_keys("PassWD")
driver.find_element_by_xpath("/html/body/div[3]/form/div[2]/ol/li[3]/a").click()
select = Select(driver.find_element_by_id('endpointId'))
# select by visible text
select.select_by_visible_text('prod-verify')
lis=["APP-BUUSAGEMONITORNG (via public URI)","APP-BUUSAGEMONITORNG-V1","APP-DSLPREORDER (via public URI)","APP-DSLPREORDER-V1","APP-DSLPREORDERMSG (via public URI)","APP-DSLPREORDERMSG-V1","APP-EMAILVERIFICATION (via public URI)","APP-EMAILVERIFICATION-V1","APP-EMAILVERIFICATIONMSG (via public URI)","APP-EMAILVERIFICATIONMSG-V1","APP-EMAILVERIFICATIONWFN (via public URI)","APP-EMAILVERIFICATIONWFN-V1","APP-LGSCACHEADMIN-B (via public URI)","APP-LGSCACHEADMIN-V1-B","APP-RUUSAGEMONITORNG (via public URI)","APP-RUUSAGEMONITORNG-V2","APP-SHOPHARDWARESTOCK (via public URI)","APP-SHOPHARDWARESTOCK-V1","APP-SPUSAGEMONITORNG (via public URI)","APP-SPUSAGEMONITORNG-V1","APP-UMCACHEADMIN-B (via public URI)","APP-UMCACHEADMIN-V1-B","App-MAIN","AppAPP-ACQUISE","AppAPP-ACQUISECPFA","AppAPP-ACQUISEWFN","AppAPP-ADMINCACHE-A","AppAPP-ADMINCACHE-B","AppAPP-ARES","AppAPP-BRANDTENANT","AppAPP-BUCUSTOMER","AppAPP-BUINLIFE","AppAPP-BUINVOICE","AppAPP-CBOMGMT","AppAPP-COMMUNICATION","AppAPP-CONTRACTEXTENSION","AppAPP-CUSTOMER","AppAPP-CUSTOMERCALLBACK","AppAPP-CUSTOMERCONSENT","AppAPP-DATAPORTABILITY","AppAPP-DEALER","AppAPP-DOCUMENTCENTER","AppAPP-DSLINLIFE","AppAPP-DSLTICKETING","AppAPP-EMAILVALIDATION","AppAPP-IDV","AppAPP-IHDMGMT","AppAPP-INLIFE","AppAPP-INLIFEMSG","AppAPP-INLIFEREPORTING","AppAPP-INLIFEWFN","AppAPP-INVOICE","AppAPP-LEAD","AppAPP-LOGISTICS","AppAPP-LOGISTICS-V2","AppAPP-LOGISTICS-V2 (via public URI)","AppAPP-MESSAGING","AppAPP-MONITORING","AppAPP-NETWORKDATAQUOTA","AppAPP-NETWORKSETTINGS","AppAPP-OFFERCAT","AppAPP-ORDERHISTORY","AppAPP-ORDERSTATUS","AppAPP-PPCUSTOMER","AppAPP-PPIN","AppAPP-PPINVOICE","AppAPP-PPMSG","AppAPP-PPORDERSTATUS","AppAPP-PPREG","AppAPP-PPUMON","AppAPP-PPWFN","AppAPP-REGISTRY","AppAPP-RIGHTOFACCESS","AppAPP-TANMGMT","AppAPP-TARIFFMIGRATION","AppAPP-THIRDPARTY","AppAPP-TICKETING","AppAPP-TOKENMGMT","AppAPP-USAGEMONITOR","AppAPP-USAGEMONITORNG","AppAPP-USER","AppAPP-VALIDATION","AppAPP-WFN","AppAPP-WHOAMI"]
row_count=1
failure_list=[]
for item in lis:
select = Select(driver.find_element_by_id('appId'))
select.select_by_value(item)
row_len=(len(driver.find_elements_by_xpath("//table/tbody/tr")))
count=0
sheet1.row(0).height_mismatch = True
sheet1.row(0).height=750
sheet1.col(1).width=256 * 40
failure_list.clear()
for i in range(2,row_len+1):
state=driver.find_element_by_xpath("/html/body/div[4]/div[3]/span/table/tbody/tr["+str(i)+"]/td[4]/span").text
if state=='OK':
count+=1
else:
failure_list.append(driver.find_element_by_xpath("/html/body/div[4]/div[3]/span/table/tbody/tr["+str(i)+"]/td[2]").text)
x=str(failure_list)[1:-1]
if count==row_len-1:
print(item," : OK")
sheet1.write(row_count,1,item,style4)
sheet1.write(row_count,2,'OK',style1)
row_count+=1
else:
sheet1.write(row_count,1,item,style4)
sheet1.write(row_count,2,'NOT OK',style2)
sheet1.write(row_count,3,x,style4)
row_count+=1
wb.save('App-ihd'+dt_string+'.xls')
driver.close()
#dropdown_menu = Select(driver.find_element_by_id('appId'))
#for option in dropdown_menu.options:
# print(option.text)
Output:
AppAPP-ACQUISEWFN : OK [28760:22664:1207/175555.208:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-ADMINCACHE-A : OK [28760:22664:1207/175555.840:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-ADMINCACHE-B : OK [28760:22664:1207/175558.022:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-ARES : OK [28760:22664:1207/175558.687:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-BRANDTENANT : OK [28760:22664:1207/175559.360:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-BUCUSTOMER : OK [28760:22664:1207/175600.442:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-BUINLIFE : OK [28760:22664:1207/175601.119:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-BUINVOICE : OK [28760:22664:1207/175604.261:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-CBOMGMT : OK [28760:22664:1207/175604.915:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-COMMUNICATION : OK [28760:22664:1207/175605.681:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-CONTRACTEXTENSION : OK [28760:22664:1207/175607.861:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-CUSTOMER : OK [28760:22664:1207/175609.158:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202 AppAPP-CUSTOMERCALLBACK : OK [28760:22664:1207/175609.859:ERROR:ssl_client_socket_impl.cc(983)] handshake fai led; returned -1, SSL error code 1, net_error -202