Tuesday

SilkPerformer - How do I monitor a server in a remote location?

How do I monitor a server in a remote location?
Problem:

How do I monitor a server in a remote location?
Resolution:

SilkPerformer's Server Analysis Module (SAM) allows you to monitor data from remote servers in a straightforward manner, however in order to monitor any application through a firewall the correct ports must be opened. SAM can use one or more of the following methods / default ports to monitor applications and servers:


Windows - PerfMon - NetBIOS ports 137, 138, 139
UNIX - REXEC - Port 512
ALL - SNMP - 161

Should opening these ports pose an unacceptable security risk a workaround is to position an agent machine inside the firewall to do the monitoring (via monitoring scripts) and then access that machine in order to retrieve the monitor data. This can then be viewed alongside the test data on a machine outside the firewall.

Another possible workaround to this problem would be to have another MMC machine on the same side of the firewall of the machine that you are monitoring. You could then use SAM on this machine to monitor, the TSD file could be created and the data used in the normal way.

A further option which may be used for Windows is to use Perfmon to convert a binary PerfMon log to a CSV file and then convert/import CSV format to Time Series Data. For more information see 50150000000AFvv

Performance Explorer can also generate BDL monitoring scripts for server monitoring, which can be directly used by SilkVision and SilkPerformer. The advantages of monitoring scripts are:

*Monitors can be placed behind firewalls using a SilkPerformer remote agent
*Monitors can be directly integrated into load testing scripts
*Monitors scripts are the most flexible way to build sophisticated monitoring scenarios including event notifications, thresholds checks, or event-based monitoring.

How to generate monitoring scripts:
1. When Performance Explorer opens in "Server Monitoring" Mode select a data source to monitor.

2. Select the performance counter(s) to be monitored (with the "Data Source Wizard" it's easy to select the measurements you wish to have monitored).

3. Create a SilkPerformer BDL script for the active monitor graph BDL scripts can be generated at any time by either selecting
"FILE | GENERATE BDL SCRIPT..." from the menu bar or by selecting
"GENERATE BDL SCRIPT..." from the context menu in Monitor View's lower pane.

4. Specify a file name for the monitor script and save the file.

5. You will be asked to save Performance Explorer's workspace. Performance Explorer then closes and the script is added to your SilkPerformer project. The SilkPerformer window pops up, showing you the new monitor script.

6. Try Script - To verify the new monitor script, press the Try Script button on the workflow bar. The default update interval for collecting monitor data is 60 seconds.

7. You can adjust the monitoring interval by opening the Project Attribute Dialog
(SilkPerformer menu: PROJECT / PROJECT ATTRIBUTES) and changing the value of the "MeasureCollectionInterval" Attribute.

Note: Ensure that realistic values appear in the Virtual User Report File.

Some additional troubleshooting steps:
1 - When monitoring Windows machines SAM uses the same technology as Microsoft's Performance Monitor (perfmon), therefore if it is not possible to get data in perfmon it will not be possible to get values in SAM.

2 - If the server that you are attempting to connect to is behind a firewall. It may be the case that ports 137,138 and 139 need to be opened on this firewall. This may be something that you need to verify with the system administrator.

3 - In order to get Performance monitor data you need to have a valid network connection to the machine. To check this see if you can browse to the machine you are trying to monitor.

Borland ID: 5105 Author: Borland Created on: 37834 Product: Category:

Monday

SilkPerformer- How can I assign unique data from a CSV file, such as UserID and Password, to each virtual user in my loadtest?

Problem:

How can I assign unique data from a CSV file, such as UserID and Password, to each virtual user in my loadtest?
Resolution:

QUESTION
----------------------
How can I assign unique data from a CSV file, such as UserID and Password, to each virtual user in my loadtest ?

ANSWER
----------------------
The script below demonstrates how this can be achieved using the GetUserID() function which has been available since SilkPerformer V. This function returns a unique number for every Virtual User in the test and this can then be used to access an unique row in the CSV file..


NOTE: Before running this script the file login.csv must be in the Data folder as defined in SETTINGS | SYSTEM | DIRECTORIES tab


- User Data Files and it must be added to the project. This can be done via PROJECT pane | DATA FILES context menu (right click)
- Add Data Files

//----------------------------------------------------------------------
// How to access unique lines in a single SilkPerformer .csv file
//----------------------------------------------------------------------
benchmark SilkPerformerRecorder

use "WebAPI.bdh"

dcluser
user VUser

transactions
TInit : begin;
TLoadtest01 : 1;
TEnd : end;
var
hfile : number;
sUserName : string;
sPassword : string;

dcltrans
transaction TInit
begin
// Load CSV and set the delimiter to ","
FileCSVLoadGlobal(hfile, "Login.csv", ",");

// The GetUserID() function will retrieve a unique ID per
// virtual user. This ID is 1 for the first virtual user,
// 2 for the second and n for the n'th virtual user.

// Move to the row in the file using the unique ID obtained
// this means UserID 1 will use row 1, UserID 2 will use
// row 2 and so on...

FileGetRow(hfile, GetUserId());

// Set the username from the file at the specified
// row from the first column

sUserName:=FileGetCol (hfile, 1, 10);

// Set the password from the file at the specified row
// from the second column

sPassword:=FileGetCol (hfile, 2, 10);

end TInit;

transaction TLoadtest01
begin
//write to username and password to the output file for checking

writeln ("UserName: "+sUserName);
writeln ("Password: "+sPassword);

end TLoadtest01;

transaction TEnd
begin
//Unload the CSV File

FileUnload(hFile);

End TEnd;
Borland ID: 5965 Author: Borland Created on:

Tuesday

QTP - Class Name , micclass , and class

Difference between Class Name, micClass, micclass, className
Difference between Class Name, micClass, micclass, className


Class Name: When looking through the object spy on any object, we'll see the test-object property "Class Name", which always equals to the QTP-Type of that object. So for example, the Class Name of a browser is "Browser", the Class Name of a WinButton is "WinButton".

However, if you wish to use the "Class Name" property to identify objects with Descriptive Programming syntax, you'd have to use the property micclass. So for example, this won't work:Browser("Class Name:=Browser")
But this will:Browser("micclass:=Browser")

So, this takes case of Class Name and micclass, what about the plain old Class and className properties? These properties are usually unique to Web objects.

className is a Run-Time object property of Web objects. You can test it yourself: build a symple HTML file, and add class="Something" to one of the HTML nodes. When you'll load that HTML file in a browser, and use the object spy on the relevant web-object, you'll see className="Something" in the Run-Time tab of the object spy.

class is simply the Test-Object property which equals the Run-Time property of className. Meaning that oWebObject.GetROProperty("class") will be the same as oWebObject.Object.className. They represent the same inner data, once through the Run-Time world, and once through the Test-Object world.

QTP -focus on particuler field

What is the method used to focus on particuler field.
to explicitly set focus on a control use .object.focus

Thursday

Send key in QTP

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{F5}"


Ref:
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx


You can use SendKeys to send more than one keystroke at a time. To do this, create a compound string argument that represents a sequence of keystrokes by appending each keystroke in the sequence to the one before it. For example, to send the keystrokes a, b, and c, you would send the string argument "abc". The SendKeys method uses some characters as modifiers of characters (instead of using their face-values). This set of special characters consists of parentheses, brackets, braces, and the:

plus sign "+",

caret "^",

percent sign "%",

and tilde "~"

Send these characters by enclosing them within braces "{}". For example, to send the plus sign, send the string argument "{+}". Brackets "[ ]" have no special meaning when used with SendKeys, but you must enclose them within braces to accommodate applications that do give them a special meaning (for dynamic data exchange (DDE) for example).

To send bracket characters, send the string argument "{[}" for the left bracket and "{]}" for the right one.

To send brace characters, send the string argument "{{}" for the left brace and "{}}" for the right one.

Some keystrokes do not generate characters (such as ENTER and TAB). Some keystrokes represent actions (such as BACKSPACE and BREAK). To send these kinds of keystrokes, send the arguments shown in the following table:

Key
Argument

BACKSPACE
{BACKSPACE}, {BS}, or {BKSP}

BREAK
{BREAK}

CAPS LOCK
{CAPSLOCK}

DEL or DELETE
{DELETE} or {DEL}

DOWN ARROW
{DOWN}

END
{END}

ENTER
{ENTER} or ~

ESC
{ESC}

HELP
{HELP}

HOME
{HOME}

INS or INSERT
{INSERT} or {INS}

LEFT ARROW
{LEFT}

NUM LOCK
{NUMLOCK}

PAGE DOWN
{PGDN}

PAGE UP
{PGUP}

PRINT SCREEN
{PRTSC}

RIGHT ARROW
{RIGHT}

SCROLL LOCK
{SCROLLLOCK}

TAB
{TAB}

UP ARROW
{UP}

F1
{F1}

F2
{F2}

F3
{F3}

F4
{F4}

F5
{F5}

F6
{F6}

F7
{F7}

F8
{F8}

F9
{F9}

F10
{F10}

F11
{F11}

F12
{F12}

F13
{F13}

F14
{F14}

F15
{F15}

F16
{F16}


To send keyboard characters that are comprised of a regular keystroke in combination with a SHIFT, CTRL, or ALT, create a compound string argument that represents the keystroke combination. You do this by preceding the regular keystroke with one or more of the following special characters:

Key
Special Character

SHIFT
+

CTRL
^

ALT
%


Note:
When used this way, these special characters are not enclosed within a set of braces.


To specify that a combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, create a compound string argument with the modified keystrokes enclosed in parentheses. For example, to send the keystroke combination that specifies that the SHIFT key is held down while:

e and c are pressed, send the string argument "+(ec)".

e is pressed, followed by a lone c (with no SHIFT), send the string argument "+ec".

You can use the SendKeys method to send a pattern of keystrokes that consists of a single keystroke pressed several times in a row. To do this, create a compound string argument that specifies the keystroke you want to repeat, followed by the number of times you want it repeated. You do this using a compound string argument of the form {keystroke number}. For example, to send the letter "x" ten times, you would send the string argument "{x 10}". Be sure to include a space between keystroke and number.

Note:
The only keystroke pattern you can send is the kind that is comprised of a single keystroke pressed several times. For example, you can send "x" ten times, but you cannot do the same for "Ctrl+x".

Note:
You cannot send the PRINT SCREEN key {PRTSC} to an application.


Example
Description
The following example demonstrates the use of a single .wsf file for two jobs in different script languages (VBScript and JScript). Each job runs the Windows calculator and sends it keystrokes to execute a simple calculation.

Copy Code








Wednesday

Hovering in QTP

1. Give FireEvent "onmouseover" ( it solved my problem)

2. Or use drescriptive programming to get class and do( doubt in that...inconsistent behavior)


Function Hovering_onWorkItemRow(objParent, Object_Class, Object_Logical_Name,TC_ID,QC_Mapping,TC_name,Step_desc,TRFileName,Action_On_Object)

wait(2)
On Error Resume Next
objParent.WebTable(Object_Logical_Name).FireEvent "onmouseover"

wait(4)

If Error.raise <>0 Then
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Failed",TRFileName)
Else
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Passed",TRFileName)
End If


End Function

Phase 1 - Layered Automation framework

Approach consist
1. There will be only one script which will take care the automation as per the data provided the user
2. The flow of testcase can be change by just changing the Sequence number in DataTable
3. User can select any predefine Table to run TestSuite ( though the schema need to be same)
4. Result is storing in .xml file (to plug-in with other code) for whole run and give Pass/Fail status for Each step in the Test.
5. There is no limit and hard coding for number of step or number of testcases.
6. OR is attaching to the testcase based on the requirement on the Runtime. SO we can maintain different OR that will help to admin the Objects
7. For any new Testcase we need to Add rows in Table (if we are not using any new resource). Otherwise Add the Object and (Class if necessary) will be suffice to accommodate new TestCase
8. Madhuri has developed the UI to fill data in Table which will help to provide correct data to data table.
Our framework will work good if
1. We are able to identify Object correctly
2. There is not much run time tweaking with Object
3. User Provide the correct set of Data in Table


Step 1- Create a Table with col

TC_ID, TC_name, Step_desc, Object_Logical_Name, Action_On_Object, Data_Value, Sequence_Number, Test_Area, Expected_Results, Testset, Parent_Hierarchy, Object_Class, Action_Type, Method, Verification, QC_Mapping, F_use1, F_use2, Object_Value

Sample Data given below:
ITCOM_OR016_994 OR 016 - Cancel creating a test case Click on Main Tab of CASO Application Main_Page_Tab Click NULL 1 SOHOM NULL 1 Browser("CASO Dashboard").Page("CASO Dashboard") WebElement NULL NULL NULL 994 NULL NULL Main


Step 2:

Fill the Few Values in table

Step 3:
Create the ORs give folder C:/Automation/OR

Step4:
'Give QTP script as below:
'******************************* START: Database access *********************
'Function GetDatabaseConnection_Fun(sServer, sDatabase, sUser, sPassword)
Dim sCon, oCon, iErr, sErr
Dim sTable, oRec, sSql, iFieldCount, sFieldName, sFieldType

sServer = "thokr02-xp"
sDatabase = "Picasso_QTP"
sUser = "sa"
sPassword = "Harvest123#"
sTable = "TC_Def"

'Assemble the connection string (Sql-Server-2000)
sCon = "Driver={SQL Server};Server=" & sServer & ";Database=" & sDatabase & ";Uid=" & sUser & ";Pwd=" & sPassword & ";"
Set oCon = CreateObject("ADODB.Connection")

'Try to connect
On Error Resume Next
oCon.Open sCon
iErr = Err.Number
sErr = Err.Description
On Error GoTo 0

'Handle Errors
If iErr <> 0 Then
GetDatabaseConnection = False
If iErr = -2147467259 Then
Msgbox "SQL Server does not exist or access denied",vbCritical,"SQL-Server Connection Error:"
ElseIf iErr = -2147217843 Then
Msgbox "Login Failed for User - Invalid User name or Password", vbCritical, "SQL-Server Connection Error:"
Else
Msgbox cStr(iErr) & " - " & sErr, vbCritical, "SQL-Server Undiagnosed Connection Error:"
End If
Else
GetDatabaseConnection = True
End If

Dim TC_ID(), TC_name(), Object_Logical_Name(), Step_desc(), Object_Value()
Dim Action_On_Object(), Data_Value(), Sequence_Number(), Test_Area()
Dim Expected_Results(), Testset(), Parent_Hierarchy(), Object_Class()
Dim Action_Type(), Method(), Verification(), QC_Mapping(), F_use1(), F_use2()

Redim TC_ID(0), TC_name(0), Object_Logical_Name(0), Step_desc(0), Object_Value(0)
ReDim Action_On_Object(0), Data_Value(0), Sequence_Number(0), Test_Area(0)
ReDim Expected_Results(0), Testset(0), Parent_Hierarchy(0), Object_Class(0)
ReDim Action_Type(0), Method(0), Verification(0), QC_Mapping(0), F_use1(0), F_use2(0)

countRow = 0

sTable = Inputbox ("Enter a Table Name in which you want to create Test steps. Remember the Order and Schema does matter so be careful.", "Table Name from database", sTable)
If sTable = "" Then
Call ExitTest()
End If

Dim uniqueTC_ID()
ReDim uniqueTC_ID(0)

uniqueCounter = 0

Set oRec = CreateObject("ADODB.Recordset")
cSqlTC = "Select distinct TC_ID from " & sTable
oRec.Open cSqlTC, oCon

set countTC = oCon.Execute("select count(distinct TC_ID) from " & sTable)

If NOT oRec.Eof Then
oRec.MoveFirst
While NOT oRec.Eof
ReDim Preserve uniqueTC_ID(uniqueCounter)
uniqueTC_ID(uniqueCounter) = oRec.Fields("TC_ID")
uniqueCounter = uniqueCounter+1
oRec.MoveNext
Wend
End If
'******************************* END: Database access *********************


'******************************* START: Navigation *********************
'Start to a create Log
TRFileName = CreateLog()

'Use Sequence number to call function
executeRow = 1
nextRowPointer = 1

For j=0 to countTC.Fields(0)-1
presentTC = uniqueTC_ID(j)
executeRow=1
set countSeqId=oCon.Execute("select count(Sequence_Number) from " & sTable & " where TC_ID= '" & presentTC & "'")
set selectedTC=oCon.Execute("select * from " & sTable & " where TC_ID= '" & presentTC & "'")
'MsgBox countSeqId.Fields(0)
For k=0 to countSeqId.Fields(0)-1
cnt = 0
For i=0 to countSeqId.Fields(0)-1
'New Code starts is here ********************************************
If NOT selectedTC.Eof Then
selectedTC.MoveFirst
While NOT selectedTC.Eof
ReDim Preserve TC_ID(cnt)
ReDim Preserve TC_name(cnt)
ReDim Preserve Step_desc(cnt)
ReDim Preserve Object_Logical_Name(cnt)
ReDim Preserve Action_On_Object(cnt)
ReDim Preserve Data_Value(cnt)
ReDim Preserve Sequence_Number(cnt)
ReDim Preserve Test_Area(cnt)
ReDim Preserve Testset(cnt)
ReDim Preserve Verification(cnt)
ReDim Preserve Expected_Results(cnt)
ReDim Preserve Parent_Hierarchy(cnt)
ReDim Preserve Object_Class(cnt)
ReDim Preserve Action_Type(cnt)
ReDim Preserve Method(cnt)
ReDim Preserve QC_Mapping(cnt)
ReDim Preserve Object_Value(cnt)
ReDim Preserve F_use1(cnt)
ReDim Preserve F_use2(cnt)

TC_ID(cnt) = selectedTC.Fields("TC_ID")
TC_name(cnt) = selectedTC.Fields("TC_name")
Step_desc(cnt) = selectedTC.Fields("Step_desc")
Object_Logical_Name(cnt) = selectedTC.Fields("Object_Logical_Name")
Action_On_Object(cnt) = selectedTC.Fields("Action_On_Object")
Data_Value(cnt) = selectedTC.Fields("Data_Value")
Sequence_Number(cnt) = selectedTC.Fields("Sequence_Number")
Test_Area(cnt) = selectedTC.Fields("Test_Area")
Expected_Results(cnt) = selectedTC.Fields("Expected_Results")
Testset(cnt) = selectedTC.Fields("Testset")
Parent_Hierarchy(cnt) = selectedTC.Fields("Parent_Hierarchy")
Object_Class(cnt) = selectedTC.Fields("Object_Class")
Action_Type(cnt) = selectedTC.Fields("Action_Type")
Method(cnt) = selectedTC.Fields("Method")
Verification(cnt) = selectedTC.Fields("Verification")
QC_Mapping(cnt) = selectedTC.Fields("QC_Mapping")
Object_Value(cnt) = selectedTC.Fields("Object_Value")
F_use1(cnt) = selectedTC.Fields("F_use1")
F_use2(cnt) = selectedTC.Fields("F_use2")

'MsgBox "TC_ID=" & TC_ID(cnt) & " " & "Step_desc=" & Step_desc(cnt) & " " & "Sequence_Number=" & Sequence_Number(cnt)
cnt=cnt+1
selectedTC.MoveNext
Wend

'OR need to associates
Dim qtAppn
Dim qtObjRes

Set qtApp = CreateObject("QuickTest.Application")
Set qtObjRes = qtApp.Test.Actions("Action1").ObjectRepositories

qtObjRes.RemoveAll

For orCount=0 to UBound(Test_Area)
'set selectedOR=oCon.Execute("select distinct(Test_Area) from " & sTable & " where TC_ID= '" & presentTC & "'")
OrName = "C:\Automation\OR\" & Test_Area(orCount) & ".tsr"
If qtObjRes.Find(OrName) = -1 Then ' If the repository cannot be found in the collection
qtObjRes.Add OrName ' Add the repository to the collection
End If
'If qtObjRes.Find("C:\Automation_backed\OR\MYREQ.tsr") = -1 Then ' If the repository cannot be found in the collection
' qtObjRes.Add "C:\Automation_backed\OR\MYREQ.tsr", 1 ' Add the repository to the collection
'End If
Next
executeRow = 1
End If
'MsgBox "executeRow=" & executeRow
'New code ends here ******************************************

'MsgBox "i =" & i & "Sequence_Number(i) =" & Sequence_Number(i) & "executeRow =" & executeRow
'MsgBox Sequence_Number(i)
If Sequence_Number(i)=executeRow then
PerformAction Object_Class(i),Object_Logical_Name(i),Object_Value(i),Data_Value(i),Action_On_Object(i),Parent_Hierarchy(i),QC_Mapping(i),TC_name(i),Step_desc(i),TRFileName,TC_ID(i),Test_Area(i)
'Call the function and fill the value
executeRow = executeRow + 1
End if
Next
Next
Next

oRec.Close
oCon.Close
Set oRec = Nothing
Set oCon = Nothing
Call CloseLog(TRFileName)
'******************************* END: Navigation *********************


'******************************* START: CreateLog while Preparinf Results *********************
Function CreateLog()
Dim TRFSO, MyTRFile, TRFileName

MyDate = date
MyDay = Day(MyDate)
MyMonth = Month(MyDate)
MyYear = Year(MyDate)
MyTime = now
MyHour = Hour(MyTime)
MyMinute = Minute(MyTime)
MySecond=Second(MyTime)

TRFileName = "C:\Automation\Results\Result" & MyDay &"_" & MyMonth & "_" & MyYear & "_" & MyHour & "_" & MyMinute & "_" & MySecond & ".xml"
'MsgBox TRFileName

Set TRFSO = CreateObject("Scripting.FileSystemObject")
Set MyTRFile = TRFSO.CreateTextFile(TRFileName)
MyTRFile.WriteLine("")
MyTRFile.WriteLine("")
MyTRFile.close
Set TRFSO = Nothing

CreateLog = TRFileName
End Function
'******************************* END: CreateLog while Preparing Results *********************


'******************************* START: WriteLog while Preparing Results *********************
Function WriteLog(TestcaseID,QC_Mapping,TC_name,Step_desc,rsltStatus,TRFileName)
Dim oTRFSO, oRsltFile
Set oTRFSO1 = CreateObject("Scripting.FileSystemObject")
Set oRsltFile = oTRFSO1.OpenTextFile(TRFileName,8,True)

On Error Resume Next
strQC_Mapping = ""
strTestcaseID = ""
strTCName = ""
strStepName = ""

oRsltFile.Writeline(strQC_Mapping)
oRsltFile.Writeline(strTestcaseID)
oRsltFile.Writeline(strTCName)
oRsltFile.Writeline(strStepName)
oRsltFile.Writeline rsltStatus
oRsltFile.Writeline "
"
oRsltFile.Writeline "
"
oRsltFile.Writeline "
"
oRsltFile.Writeline "
"
End Function
'******************************* END: WriteLog while Preparing Results *********************


'******************************* START: CloseLog while Preparing Results *********************
Function CloseLog(TRFileName)
Dim TRFSO, MyTRFile
Set oTRFSO2 = CreateObject("Scripting.FileSystemObject")
Set oRsltFile_Close = oTRFSO2.OpenTextFile(TRFileName,8,True)
oRsltFile_Close.WriteLine("
")
oRsltFile_Close.close
Set oTRFSO2 = Nothing
End Function
'******************************* END: CloseLog while Preparing Results *********************


'******************************* START: PerformAction *********************
Function PerformAction(Object_Class, Object_Logical_Name, Object_Value, Data_Value, Action_On_Object, Parent_Hierarchy, QC_Mapping, TC_name, Step_desc, TRFileName, TC_ID, Test_Area)
Dim objParent
Dim Parent_Hierarchy_flag
Parent_Hierarchy_flag = 0

Select Case Parent_Hierarchy
Case "Browser(""CASO Dashboard"").Page(""CASO Dashboard"")"
Set objParent = Browser("CASO Dashboard").Page("CASO Dashboard")
Parent_Hierarchy_flag = 1
Case Else
Parent_Hierarchy_flag = 0
'MsgBox "hierarchy does Not exist in OR" & Parent_Hierarchy
End Select


'Dim Msg,MyParent_Hierarchy,Parent_Hierarchy_list,hir_Rank
'MyParent_Hierarchy = Parent_Hierarchy
'Parent_Hierarchy_list = Split(MyParent_Hierarchy, ".", -1, 1)
'hir_Rank = 0
'For ArrayItem = 0 To UBound(Parent_Hierarchy_list)
'Msg = Parent_Hierarchy_list(ArrayItem)
'If Parent_Hierarchy_list(ArrayItem)="Browser(""CASO Dashboard"")" Then
'hir_Rank=hir_Rank+1
'set objParent1=Browser("CASO Dashboard")
'Select Case Parent_Hierarchy_list(ArrayItem+1)
'Case "Page(""CASO Dashboard"")"
'hir_Rank=hir_Rank+1
'Select Case Parent_Hierarchy_list(ArrayItem+2)
'Case "new Hirerchy Add here"
'hir_Rank=hir_Rank+1
'MsgBox "new Hirerchy Add here"
'case else
'MsgBox "No new Hirerchy Add here"
'' new Hirerchy Add here
'End Select
'MsgBox "hi"
'End Select


'If Parent_Hierarchy_list(ArrayItem+1)="Page(""CASO Dashboard"")" Then
' MsgBox "Hi"
'End If
'End If
'Next

'Parent_Hierarchy = cStr(Parent_Hierarchy)
'hierarchy1 = cStr(Browser("CASO Dashboard").Page("CASO Dashboard"))
'If Parent_Hierarchy = eval ("Browser("CASO Dashboard").Page("CASO Dashboard")") Then
'If Parent_Hierarchy = "Browser("CASO Dashboard").Page("CASO Dashboard")" Then
' MsgBox "Parent_Hierarchy2 =" & Parent_Hierarchy
'End If

'Set objParent=Browser("CASO Dashboard").Page("CASO Dashboard")
'Set objParent=Parent_Hierarchy

If Parent_Hierarchy_flag = 1 then
Select Case Object_Class
Case "WebElement"
On Error Resume Next
Select Case Action_On_Object
Case "Click"
If objParent.WebElement(Object_Logical_Name).Exist then
objParent.WebElement(Object_Logical_Name).Click
End if
Case "Exist"
objParent.WebElement(Object_Logical_Name).Exist
Case "GetROProperty"
If objParent.WebElement(Object_Logical_Name).Exist then
getProp_webElmnt = objParent.WebElement(Object_Logical_Name).GetROProperty("name")
'PerformAction = getProp_webElmnt
End if
Case "GetTOProperty"
If objParent.WebElement(Object_Logical_Name).Exist then
getProp_webElmnt = objParent.WebElement(Object_Logical_Name).GetTOProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "SetTOProperty"
If objParent.WebElement(Object_Logical_Name).Exist then
objParent.WebElement(Object_Logical_Name).GetTOProperty "name",val
End if
Case "ToString"
If objParent.WebElement(Object_Logical_Name).Exist then
strWebElement=objParent.WebElement(Object_Logical_Name).ToString
MsgBox "strWebElement= " & strWebElement
End if
End Select

If Err.Number <> 0 Then
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Failed",TRFileName)
Else
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Passed",TRFileName)
End If
Case "WebButton"
On Error Resume Next
Select Case Action_On_Object
Case "Click"
If objParent.WebButton(Object_Logical_Name).Exist then
objParent.WebButton(Object_Logical_Name).Click
End if
Case "Exist"
objParent.WebButton(Object_Logical_Name).Exist
Case "GetROProperty"
If objParent.WebButton(Object_Logical_Name).Exist then
getProp_webElmnt = objParent.WebButton(Object_Logical_Name).GetROProperty("name")
'PerformAction = getProp_webElmnt
End if
Case "GetTOProperty"
If objParent.WebButton(Object_Logical_Name).Exist then
getProp_webElmnt=objParent.WebButton(Object_Logical_Name).GetTOProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "SetTOProperty"
If objParent.WebButton(Object_Logical_Name).Exist then
objParent.WebButton(Object_Logical_Name).GetTOProperty "name",val
End if
Case "ToString"
If objParent.WebButton(Object_Logical_Name).Exist then
strWebElement = objParent.WebButton(Object_Logical_Name).ToString
MsgBox "strWebElement= " & strWebElement
End if
End Select

If Err.Number <> 0 Then
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Failed",TRFileName)
Else
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Passed",TRFileName)
End If

Case "WebEdit"
On Error Resume Next
Select Case Action_On_Object
Case "Set"
If Action_On_Object="Set" Then
objParent.WebEdit(Object_Logical_Name).set Data_Value
End If
Case "Click"
If objParent.WebEdit(Object_Logical_Name).Exist then
objParent.WebEdit(Object_Logical_Name).Click
End if
Case "Exist"
objParent.WebEdit(Object_Logical_Name).Exist
Case "GetROProperty"
If objParent.WebEdit(Object_Logical_Name).Exist then
getProp_webElmnt=objParent.WebEdit(Object_Logical_Name).GetROProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "GetTOProperty"
If objParent.WebEdit(Object_Logical_Name).Exist then
getProp_webElmnt=objParent.WebEdit(Object_Logical_Name).GetTOProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "SetTOProperty"
If objParent.WebEdit(Object_Logical_Name).Exist then
objParent.WebEdit(Object_Logical_Name).GetTOProperty "name",val
End if
Case "ToString"
If objParent.WebEdit(Object_Logical_Name).Exist then
strWebEdit=objParent.WebEdit(Object_Logical_Name).ToString
MsgBox "strWebEdit= " & strWebEdit
End if
Case "Select"
If objParent.WebEdit(Object_Logical_Name).Exist then
objParent.WebEdit(Object_Logical_Name).select Data_Value
End If
End Select

If Err.Number <> 0 Then
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Failed",TRFileName)
Else
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Passed",TRFileName)
End If

Case "Link"
On Error Resume Next
Select Case Action_On_Object
Case "Click"
If objParent.Link(Object_Logical_Name).Exist then
objParent.Link(Object_Logical_Name).Click
end if
Case "Exist"
objParent.Link(Object_Logical_Name).Exist
Case "GetROProperty"
If objParent.Link(Object_Logical_Name).Exist then
getProp_webElmnt=objParent.Link(Object_Logical_Name).GetROProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "GetTOProperty"
If objParent.Link(Object_Logical_Name).Exist then
getProp_webElmnt=objParent.Link(Object_Logical_Name).GetTOProperty("name")
'PerformAction=getProp_webElmnt
End if
Case "SetTOProperty"
If objParent.Link(Object_Logical_Name).Exist then
objParent.Link(Object_Logical_Name).GetTOProperty "name",val
End if

Case "ToString"
If objParent.Link(Object_Logical_Name).Exist then
strLink=objParent.Link(Object_Logical_Name).ToString
MsgBox "strLink= " & strLink
End if
End Select

If Err.Number <> 0 Then
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Failed",TRFileName)
Else
Call WriteLog(TC_ID,QC_Mapping,TC_name,Step_desc,"Passed",TRFileName)
End If

Case "Image"
On Error Resume Next
Select Case Action_On_Object
Case "Click"
If objParent.Image(Object_Logical_Name).Exist then
objParent.Image(Object_Logical_Name).Click
End If
Case "Exist"
objParent.Link(Object_Logical_Name).Exist
End Select
Case "VirtualObject"
'Browser("CASO Dashboard").Page("CASO Dashboard").WebTable("WRKITM_FirstRow_Table").Click
Case "WebTable"
If objParent.WebTable(Object_Logical_Name).Exist then
objParent.WebTable(Object_Logical_Name).Click
'Browser("CASO Dashboard").Page("CASO Dashboard").WebTable("WRKITM_FirstRow_Table").Click
End if
Case Else
MsgBox "Class Not Found"
End Select
End If 'This of just upper line of the Select statment

'End and Exit from log file
End Function
'******************************* END: PerformAction *********************

Step 5:

the Folder should be C:\Automation and all other folder should inside it.


Step6:
Check the result in xml file at C:\Automation\Result folder