Sunday, August 23, 2015

main driver

On Error Resume Next
strFolderPath = Split(Environment.Value("TestDir"),"Test Scripts")(0)
strDataTablePath = strFolderPath & "Local Test Data\\"
strFunLibrPath = strFolderPath & "Local Functions\"
strInputFile = strDataTablePath & "1.xls"

Environment.Value("RowNo") = 1
Environment.Value("SNo") = 1
Environment.Value("strResultFile") = ""

fnQTPConfigurationSettings()           ' Sets the QTP Test Settings automatically
fnSetLoginCredentials(strInputFile)       ' Sets the Login Credentials to Environment Variables☺

DataTable.AddSheet("GroupSelector")
DataTable.ImportSheet strInputFile,"GroupSelector","GroupSelector"
intActCount = Datatable.GetSheet("GroupSelector").GetRowCount

For index = 1 To intActCount

DataTable.GetSheet("GroupSelector").SetCurrentRow(index)

If DataTable.Value("Execute","GroupSelector") = "Y" Then

strGroupName = DataTable.Value("TestGroupName","GroupSelector") ' Sheet Name = Vbs file Name = GroupName
Environment.Value("GroupDescription") = DataTable.Value("GroupDescription","GroupSelector")
strGroupSheet = strGroupName
DataTable.AddSheet(strGroupSheet)
DataTable.ImportSheet strInputFile,strGroupName,strGroupSheet      ' Loads the Input Data Sheet of required Group
Environment.Value("TestGroupName") = strGroupName
Environment.Value("CureentSheet")=strGroupName

Environment.Value("GPStatus") = "True"

'    ExecuteFile strFunLibrPath&strGroupName&".vbs"
strFunName = strGroupName&"("&Chr(34)&strGroupSheet&Chr(34)&")"
                   
Call Eval(strFunName)         'Runs the corresponding <strGroupName>.Vbs Main function ; which will run for Each testcase as mentioned in Corresponding sheet rows

If Environment.Value("GPStatus") = "True"  Then
fnReportingManager "GPPass", "Execution Complete for Group : " & Environment.Value("TestGroupName"),Environment.Value("TestGroupName") ,"", Environment.Value("TestGroupName")
Else
fnReportingManager "GPFail", "Execution Complete for Group : " & Environment.Value("TestGroupName"),Environment.Value("TestGroupName") ,"", Environment.Value("TestGroupName")
'     desktop.CaptureBitmap strFolderPath&"Result\"&strUseCaseName&".bmp", True
End If
DataTable.DeleteSheet(strGroupSheet)
End If

Next

Print "Done"

13 comments:

  1. Good post, this institute seems dedicated to student success.
    full stack developer java course

    ReplyDelete
  2. Nice Blog post ...Thanks for posting such an amazing content
    DevOps Training institute in Ameerpet

    ReplyDelete
  3. "Enhance your data analytics skills with our power bi and tableau courses designed for beginners and professionals alike. Learn to create interactive dashboards, visualize data effectively, and make data-driven decisions with confidence."

    ReplyDelete
  4. Android training courses offer complete mobile development education.They focus on real-world applications.Practice boosts confidence.This Android training courses support professional goals.They are effective.

    ReplyDelete
  5. EasyPayTax simplifies taxation by offering professional GST, income tax, and business compliance services, ensuring smooth filings, reduced errors, and complete peace of mind.income tax filing services in Hyderabad

    ReplyDelete
  6. Learn data analytics with hands-on power bi and tableau courses that turns raw data into clear, actionable insights.

    ReplyDelete
  7. "Boost your career with sfdc admin training designed for mastering Salesforce administration skills.

    ReplyDelete
  8. "Enhance your data visualization skills with tableau training Learn to create interactive dashboards and insightful reports for smarter business decisions."

    ReplyDelete
  9. "Enhance your career with sales force admin course designed to equip you with essential skills in managing and customizing Salesforce. Learn practical tools and best practices to become a certified Salesforce administrator."

    ReplyDelete
  10. Great explanation! 👍 This article makes the concept of the main driver in QTP/UFT really easy to understand. The examples are clear and practical, and I especially liked how you showed the flow between the driver script and function libraries. Thanks for sharing — it’s very helpful for beginners learning how to structure their automation scripts!
    Devops Training in Hyderabad

    ReplyDelete