Sif file is a text file containing information about a user's connection to the Internet. It contains information about the user's username, password, e-mail address, email subject, and email recipient. It also contains information about how to use sif files.
Sif file is a text file containing information about a user's connection to the Internet. It contains information about the user's username, password, e-mail address, email subject, and email recipient. It also contains information about how to use sif files.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
Sif file is a text file containing information about a user's connection to the Internet. It contains information about the user's username, password, e-mail address, email subject, and email recipient. It also contains information about how to use sif files.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
s '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public DriverPath,OrPath,FunctionPath,URL,UserName,Password,MailSendTo,MailSubje ct,MailCcTo,DataToDTB,ReportPath,DsnName LoginFlag=0 Public function ReadDataFromSif(SIFPATH) datatable.Import(SIFPATH) RowCount=datatable.GetRowCount For i=1 to RowCount datatable.SetCurrentRow(i) Choose = datatable.Value("Variable_Name") Values= datatable.Value("Value") Select Case Choose Case "DriverPath" DriverPath=Values Case "OrPath" OrPath=Values Case "FunctionPath" FunctionPath = Values Case "DsnName" DsnName=Values Case "URL" URL=Values Case "UserName" UserName=Values Case "Password" Password=Values Case "MailSen dTo" MailSendTo=Values Case "MailSubject" MailSubject=Values Case "MailCcTo" MailCcTo=Values Case "DataToDTB" DataToDTB=Values Case "ReportPath" ReportPath=Values End Select Next End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function Read The Driver Sheet '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function ReadDriverSheet() datatable.Import(DriverPath) ReadDriverSheet=datatable.GetRowCount End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' Function Application Load '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function ApplicationLoad() Systemutil.Run URL End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function For Login '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function LogIn() systemutil.Run URL repositoriescollection.Add(OrPath&"UserLogin.tsr") Browser("UserLogin").Page("UserLogin").Image("Home").Click Browser("UserLogin").Page("UserLogin").WebEdit("userName").Set UserName Browser("UserLogin").Page("UserLogin").WebEdit("password").Set Password Browser("UserLogin").Page("UserLogin").Image("Sign-In").Click FindPath=repositoriescollection.find(OrPath&"UserLogin.tsr") repositoriescollection.Remove(FindPath) LoginFlag=1 End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function TogetScreenName,StartTestCaseNumber,EnfTestCaseNumber '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public ParentScreenName,StartTestCaseNumber,EndTestCaseNumber Public function GetScreenname_StartTcNO_EndTcNo(ScreenName) datatable.Import(DriverPath) datatable.SetCurrentRow(ScreenName) ParentScreenName=datatable.Value("ParentScreenName") StartTestCaseNumber=datatable.Value("StartTestCaseNumber") EndTestCaseNumber=datatable.Value("EndTestCaseNumber") End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Funtion to get data from routing table '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public MenuToClick,Flag,ManualTestCaseNumber,CurrentScreenArray(),CurrentScreenC ounter Public function GetDataFromRoutingTable(AutomationTestCaseNumber) Set Database=createobject ("adodb.connection") Set Recordset=createobject ("adodb.Recordset") Database.connectionstring=DsnName Database.open Recordset.open"select * from RoutingTable where AutomationTestCaseNo="&Automa tionTestCaseNumber&" and ParentScreenName='"&ParentScreenName&"'", Database MenuToClick=Recordset("MenuToClick") Flag=Recordset("Flag") ManualTestCaseNumber=Recordset("ManualTestCaseNo") CurrentScreenCounter=0 While not Recordset.eof CurrentScreenCounter=CurrentScreenCounter+1 ReDim preserve CurrentScreenArray(CurrentScreenCounter) CurrentScreenArray(CurrentScreenCounter)=Recordset("CurrentScreenName ") Recordset.Movenext Wend GetDataFromRoutingTable=CurrentScreenCounter End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function Load OR '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function LoadOr(SubTestCase) Position = repositoriescollection.Find(OrPath&CurrentScreenArray(SubTestCase) &".tsr") If Position >0 Then Msgbox "Already OR Added" else repositoriescollection.add(OrPath&CurrentScreenArray(SubTestCase)&".t sr") End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function To UnLoad OR '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function UnLoadOr(SubTestCase) Position = repositoriescollection.Find(OrPath&CurrentScreenArray(SubTestCase) &".tsr") If Position >0 Then GetOr=repositoriescollection.Find(OrPath&CurrentScreenArray(SubTestCa se)&".tsr") repositoriescollection.remove(GetOr) else Msgbox "Repositories Not Present in the OR " End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' Funct ion To get Logical Name And Class Name '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public PageName,BrowserName,ClassName,WebElements(),DataEntryObject(),DataEntryO bjectClass(),DataEntryObjectCounter Public function GetLogicalNameClassName(SubTestCase) Set ObjectRepository=Createobject ("Mercury.objectrepositoryutil") ObjectRepository.load OrPath&CurrentScreenArray(SubTestCase)&".tsr" Set AllObjectCount=ObjectRepository.getallobjects() LoadedObjectCountInOR=AllObjectCount.count DataEntryObjectCounter=0 x=0 For ObjectCount=0 to LoadedObjectCountInOR-1 Set OneObject=AllObjectCount.item(ObjectCount) ClassName=OneObject.gettoproperty("class name") If ClassName="Browser" Then BrowserName =ObjectRepository.getlogicalname(OneObject) End If If ClassName="Page" Then PageName=ObjectRepository.getlogicalname(OneObject) End If If ClassName="WebElement" Then x=x+1 ReDim preserve WebElements(x) WebElements(x)=ObjectRepository.getlogicalname(OneObject) End If If ClassName="WebEdit" or ClassName="WebCheckBox" or ClassName="WebL ist" or ClassName="WebRadioGroup"Then DataEntryObjectCounter=DataEntryObjectCounter+1 ReDim preserve DataEntryObject(DataEntryObjectCounter) DataEntryObject(DataEntryObjectCounter)=ObjectRepository.getl ogicalname(OneObject) ReDim preserve DataEntryObjectClass(DataEntryObjectCounter) DataEntryObjectClass(DataEntryObjectCounter)=OneObject.gettop roperty("class name") End If Next For i=1 to DataEntryObjectCounter For j=i+1 to DataEntryObjectCounter If DataEntryObject(i)>DataEntryObject(j) Then Store=DataEntryObject(i) DataEntryObject(i)=DataEntryObject(j) DataEntryObject(j)=Store Store=DataEntryObjectClass(i) DataEntryObjectClass(i)=DataEntryObjectClass(j) DataEntryObjectClass(j)=Store End If Next Next Set OneObject =nothing Set AllObjectCount= nothing Set ObjectRepository= nothing End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' Function Data Array Creation '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public ObjectToClick,ExpectedPopUpMsg,ExpectedFrameMsg,DataArrayCollection() Public function GetDataArrayCreation(SubTestCase,AutomationTestCaseNumber) Set Database=createobject ("adodb.connection") Set Recordset=createobject ("adodb.Recordset") Database.connectionstring=DsnName Database.open Recordset.open"select * from "&CurrentScreenArray(SubTestCase)&" where SubTes tCaseNo="&SubTestCase&"and AutomationTestCaseNo="&AutomationTestCaseNumber,Datab ase ObjectToClick=Recordset("ObjectToClick") ExpectedPopUpMsg=Recordset("ExpectedPopUpMsg") ExpectedFrameMsg=Recordset("ExpectedFrameMsg") While not Recordset.eof For i=1 to DataEntryObjectCounter ReDim preserve DataArrayCollection(i) DataArrayCollection(i)=Recordset(DataEntryObject(i)) Next Recordset.MoveNext Wend For i=1 to DataEntryObjectCounter If isempty(DataArrayCollection(i))<> true and isnull (DataArrayCollec tion(i))<>true Then else DataArrayCollection(i)="" End If Next End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function To Substitute '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function SubstituteData() For Substitute=1 to DataEntryObjectCounter If len(DataArrayCollection(Substitute)) >0 Then Select Case DataEntryObjectClass(Substitute) Case "WebEdit" Browser(BrowserName).Page(PageName).WebEdit(DataEntry Object(Substitute)).Set DataArrayCollection(Substitute) Case "WebCheckBox" Browser(BrowserName).Page(PageName).WebCheckBox(DataE ntryObject(Substitute)).Set DataArrayCollection(Substitute) Case "WebList" Browser(BrowserName).Page(PageName).WebList(DataEntry Object(Substitute)).Select DataArrayCollection(Substitute) Case "WebRadioGroup" Browser(BrowserName).Page(PageName).WebRadioGroup(Dat aEntryObject(Substitute)).Select DataArrayCollection(Substitute) End Select End If Next End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Func tion Object to Click '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function ToClick() If len (ObjectToClick)>0 Then Browser(BrowserName).Page(PageName).Image(ObjectToClick).Click End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' Function Menu To Click '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public function MenusToClick(SubTestCase) If len(MenuToClick)>0 Then If MenuToClick="Register" and CurrentScreenArray(SubTestCase)="Regist er" Then repositoriescollection.add(OrPath&"Pannel.tsr") Browser("Pannel").Page("Pannel").Image(MenuToClick).Click 'MenuToClick="" got =repositoriescollection.Find(OrPath&"Pannel.tsr") repositoriescollection.Remove(got) elseif MenuToClick="Flights" and CurrentScreenArray(SubTestCa se)="FindAFlight" then If Flag="Yes" and LoginFlag=0 Then LogIn() End If If Flag="Yes" Then repositoriescollection.add(OrPath&"Pannel.tsr ") Browser("Pannel").Page("Pannel").Image(MenuTo Click).Click 'MenuToClick="" got =repositoriescollection.Find(OrPath&"Pannel.tsr") repositoriescollection.Remove(got) End If End If End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' Function For Actual result '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Actual,Status Public Function ActualResult() If len(ExpectedFrameMsg)>0 Then For web=1 to ubound(WebElements) If Browser(BrowserName).Page(PageName).WebElement(WebElements (web)).Exist (3) Then Actual=Browser(BrowserName).Page(PageName).WebElement (WebElements(web)).getroproperty("innertext") Exit for End If Next If ExpectedFrameMsg=Actual Then reporter.ReportEvent micPass,ExpectedFrameMsg,Actual Status="Pass" else reporter.ReportEvent micFail,ExpectedFrameMsg,Actual Status="Fail" End If End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function Result In DataBase" '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function ResultsInDatabase(SubTestCase,AutomationTestCaseNumber) If len(ExpectedFrameMsg)>0 Then Set Database=createobject ("adodb.connection") Set Recordset=createobject ("adodb.Recordset") Database.connectionstring=DataToDTB Database.open Recordset.open"insert into Results values('"&ManualTestCaseNumber&"',"&Au tomationTestCaseNumber&","&SubTestCase&",'"&ExpectedFrameMsg&"','"&Actual&"','"& Status&"')", Database End If End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Function Application Close '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Function ApplicationClose() repositoriescollection.add(OrPath&"UserLogin.tsr") Browser("UserLogin").close gets=repositoriescollection.Find(OrPath&"UserLogin.tsr") repositoriescollection.Remove(gets) End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Function to Delete Previous Record '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Function ReportDelete() Set Database=createobject ("adodb.connection") Set Recordset=createobject ("adodb.Recordset") Database.connectionstring=DataToDTB Database.open Recordset.open"Delete from Results",Database End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Function to Export Result To Excel '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Function ExportToExcel() Set Database=createobject ("adodb.connection") Set Recordset=createobject ("adodb.Recordset") Database.connectionstring=DataToDTB Database.open Recordset.open"select *from Results",Database ColumnCount=Recordset.fields.count For i=0 to ColumnCount-1 datatable.LocalSheet.AddParameter Recordset(i).name," " Next z=1 While not Recordset.eof For i=0 to ColumnCount-1 datatable.SetCurrentRow(z) datatable.Value(Recordset(i).name,dtlocalsheet)=Recordset(i) Next z=z+1 Recordset.MoveNext Wend yr=datepart("yyyy",date) dat=datepart("d",date) m=datepart("m",date) mon=monthname(m,true) datatable.ExportSheet ReportPath&Reports&"-"&yr&"-"&mon&"-"&dat&".xls","Action 1" End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Function Reports In Html '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Function ReportsInHtml() Set FSO=createobject("Scripting.filesystemobject") Set HtmlFile=FSO.opentextfile(ReportPath&"Reports.html",2,true) RowCount=datatable.GetSheet("Action1").getrowcount HtmlFile.writeline"<html><title>Reports</title><heading><p align="&"center>"& "<b>"&"<marquee>HTML REPORT FOR USER REGISTRATION AND BOOKING FLIGHT</marquee>"& "</b></p></heading><br><br><body><table border="&"2"&"width="&"25%"&"height="&"2 5%><tr>" HtmlFile.writeline"<td bgcolor =Aqua height=63>ManualTestCaseNumber</td>" HtmlFile.writeline"<td bgcolor =Aqua height=63>AutomationTestcaseNumber</td>" HtmlFile.writeline"<td bgcolor =Aqua height=63>SubtestCaseNumber</td>" HtmlFile.writeline"<td bgcolor =Aqua height=63>ExpectedFrameMsg</td>" HtmlFile.writeline"<td bgcolor =Aqua height=63>Actual</td>" HtmlFile.writeline"<td bgcolor =Aqua height=63>Status</td>" HtmlFile.writeline"<tr>" For i=1 to RowCount datatable.SetCurrentRow(i) HtmlFile.writeline"<td bgcolor =Gray height=63>"&(datatable.Value("Ma nualTestCaseNo",dtlocalsheet))&"</td>" HtmlFile.writeline"<td bgcolor =Gray height=63>"&(datatable.Value("Au tomationTestCaseNo",dtlocalsheet))&"</td>" HtmlFile.writeline"<td bgcolor =Gray height=63>"&(datatable.Value("Su bTestCaseNo",dtlocalsheet))&"</td>" HtmlFile.writeline"<td bgcolor =Gray height=63>"&(datatable.Value("Ex pectedFrameMsg",dtlocalsheet))&"</td>" HtmlFile.writeline"<td bgcolor =Gray height=63>"&(datatable.Value("Ac tual",dtlocalsheet))&"</td>" If datatable.Value("Status",dtlocalsheet)="Pass" Then HtmlFile.writeline"<td bgcolor =Green height=63>"&(datatable.Value("Statu s",dtlocalsheet))&"</td>" else HtmlFile.writeline"<td bgcolor =Red height=63>"&(datatable.Value("St atus",dtlocalsheet))&"</td>" end if HtmlFile.writeline"</tr>" Next HtmlFile.writeline"</td></td></table></body></html>" End Function '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' Function To Send Mail '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Function SendReportsThroughMail() SendTo= MailSendTo Subject=MailSubject CC=MailCcTo Body="HI,"&vbcrlf&vbcrlf&"Please find the Report Attachmed with this mail"&vb crlf&vbcrlf&"Thanks and Regards"&vbcrlf&vbcrlf&"MohanParasuraam" Attachment=ReportPath&"Reports.html" Set Outlook1=createobject("outlook.application") Set mail = Outlook1.createitem(0) mail.to=SendTo mail.cc=CC mail.subject=Subject mail.Body=Body If (Attachment<>"") Then mail.Attachments.add(Attachment) End If mail.send Outlook1.quit Set mail=nothing Set Outlook1=nothing End Function