Sei sulla pagina 1di 17

258322243.

doc

Table of Contents
Descriptive Programming....................................................2
Background......................................................................................................................2
Concept of Descriptive Programming.............................................................................2
Why Descriptive Programming based scripting framework...........................................2
Contents on a Web Page..................................................................................................3

Function Library..................................................................4
1.) Common Function......................................................................................................4
Use...............................................................................................................................4
Arguments....................................................................................................................4
Code and Explanation..................................................................................................4
2.) Search Function..........................................................................................................6
Use...............................................................................................................................6
Arguments....................................................................................................................6
Code and Explanation..................................................................................................7
3.) NextScreen Function................................................................................................10
Use:............................................................................................................................10
Arguments..................................................................................................................10
Code and Explanation................................................................................................10
4.) CommonTable Function...........................................................................................11
Use:............................................................................................................................11
Arguments..................................................................................................................11
Code...........................................................................................................................11
5.) SearchTable Function...............................................................................................12
Use.............................................................................................................................12
Arguments..................................................................................................................12
Code...........................................................................................................................13
6.) ClearCell Function...................................................................................................14
Use.............................................................................................................................14
Arguments..................................................................................................................14

Page 1

1/25/2015

258322243.doc

Descriptive Programming
Background
Quick Test Professional (QTP) while recording stores all the properties required to define
web objects in its object repository. When the script is run the object repository is used to
identify the objects in the application.
When an operation is recorded on an object, Quick Test Professional adds the appropriate
test object to the object repository along with its properties. Once the object along with its
property is added in the object repository, statements can be added in the Expert View of
the tool to perform additional methods/functions on the added object.
The statements are added usually by entering the name (not case sensitive) of each of the
objects in the object's hierarchy as the object description, and then add the appropriate
method.

Concept of Descriptive Programming


Instructing Quick Test Professional to perform methods on objects without referring to
the object repository or to the object's name is done using descriptive programming.
By providing Quick Test Professional with a list of properties and values that are required
identify the object or objects in an application one can perform any desired
method/function using these objects.
Such a programmatic description is very useful while performing an operation on an
object that is not stored in the object repository to perform the same operation on several
objects with certain identical properties or to perform an operation on an object whose
properties change dynamically during every run.

Why Descriptive Programming based scripting framework


Following are the advantages of Descriptive Programming based framework

Script independent of Object Repository makes it more robust.


Reduces rework in an environment where object properties change regularly.

Reduces Test Case preparation time after a generic code is created.

Generic code can be used for any kind of Web Application which increases
reusability.

Single script is used for test case preparation : single script, multiple usage

Page 2

1/25/2015

258322243.doc

Application failures can be accurately identified.

Condition based testing Captures hidden controls on the application which are
visible on the fulfillment of certain criteria thereby reducing the count of invalid
defects

Contents on a Web Page


A typical Web Page will have the following class objects

WebList Refers to the dropdown.


WebEdit Refers to the text/edit box.

WebCheckBox Refers to the check box.

WebRadioGroup Refers to the radio button.

WebElement Refers to all the web objects on an HTML page.

Image Refers to an image on the screen.

Link Refers to the hyperlink on the screen.

WebTable Refers to the Web Table on the screen.

Page 3

1/25/2015

258322243.doc

Function Library
1.) Common Function
Use
Common Function gets all the objects of a screen along with its properties in an Excel
sheet.

Arguments
Common Function has five arguments
1. excelSheet: The existing sheet in C drive
2. snameBrowser: The name of the Browser
3. stitlePage: The Title of the Page
4. val: The type of control
5. val2: The value of Property HTML tag in case of WebElement otherwise Blank

Code and Explanation


Content of Common Function
Set Obj=Description.create()

Creates an object of Description Class

If val = "WebElement" Then


Obj("micclass").Value = val
Obj("html tag").Value = val2
Set List=Browser("name:="&snameBrowser).Page("title:="&stitlePage).ChildObjects(Obj)

If the Class is WebElement, the object is defined by two properties, micclass and html
tag.
List will contain all the childobjects of type WebElement with the mentioned html tag.
objcount=List.count()
rowCount = excelSheet.UsedRange.Rows.count

Page 4

1/25/2015

258322243.doc
objcount contains the number of childobjects of type WebElement with the mentioned
html tag.
rowcount contains the number of filled (used) rows of the excel sheet.
For j=0 to objcount-1
excelSheet.Cells(rowCount + 1 , "A") = snameBrowser
excelSheet.Cells(rowCount + 1 , "B") = stitlePage
If val2 = "SPAN" Then
arr2=List(j).GetROProperty("html id")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "D") = arr2
'MyArray = Split(arr2, "_", -1, 1)
'No=Ubound(MyArray)
'excelSheet.Cells(rowCount + 1 , "D") = MyArray(No)
excelSheet.Cells(rowCount + 1 , "C") = val
arr1=List(j).GetROProperty("innerText")
excelSheet.Cells(rowCount + 1 , "G") = arr1
rowCount = rowCount + 1
Else
rr2=List(j).GetROProperty("innerhtml")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "D") = arr2
'MyArray = Split(arr2, ",", -1, 1)
'No=Ubound(MyArray)
'excelSheet.Cells(rowCount + 1 , "D") = MyArray(No)
excelSheet.Cells(rowCount + 1 , "C") = val
arr1=List(j).GetROProperty("innerText")
excelSheet.Cells(rowCount + 1 , "G") = arr1
rowCount = rowCount + 1
End if
Next

Populates the excelSheet with controls, properties value i.e identifier


If the value of Html tag is SPAN then get value of the html id and populate it in
excelSheet into column F
Splitting the html id with _ as separator and storing the last part of the html id into
column D
Populate the column C with WebElement
Populate the column G with the value of innerText
Otherwise
Get the value of innerhtml and populate it in column F and column D
Split the value of innerhtml separated by comma and last portion of the value into
columnD
Populate the column C with WebElement

Page 5

1/25/2015

258322243.doc

Else
Obj("micclass").Value = val
Set List =Browser("name:="&snameBrowser).Page("title:="&stitlePage).ChildObjects(Obj)
objcount=List.count()
rowCount = excelSheet.UsedRange.Rows.count
For j=0 to objcount-1
arr1=List(j).GetROProperty("Name")
excelSheet.Cells(rowCount + 1 , "E") = arr1
MyArray = Split(arr1, "$", -1, 1)
No=Ubound(MyArray)
excelSheet.Cells(rowCount + 1 , "D") = MyArray(No)
excelSheet.Cells(rowCount + 1 , "A") = snameBrowser
excelSheet.Cells(rowCount + 1 , "B") = stitlePage
arr2=List(j).GetROProperty("html id")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "C") = val
arr3=List(j).GetROProperty("value")
excelSheet.Cells(rowCount + 1 , "G") = arr3
If val = "Image" Then
arr2=List(j).GetROProperty("html id")
excelSheet.Cells(rowCount + 1 , "F") = arr2
End If
If val = "WebRadioGroup" Then
arr2=List(j).GetROProperty("value")
excelSheet.Cells(rowCount + 1 , "G") = arr2
End If
rowCount = rowCount + 1
Next
End if
End Function

For Classes other than WebElement,


Set the property of the object Obj as micclass and assign it the value which is passed
into the function
Get the value of html id and the name of all the child objects of object Obj and populate it
into column F and E
Split the name values separated by $ and populate the column D with the last portion
of the name values
If the micclass value of object Obj is WebRadioGroup, populate the column G with
the value of the Property value.

2.) Search Function


Use
Search Function searches the identifier from the Excelsheet

Page 6

1/25/2015

258322243.doc

Arguments
One argument is passed in this function.
excelSheet: The existing sheet in the C: drive

Code and Explanation


Function Search (excelSheet)

Variables
Dim X, XL, Row, iRow , xRow, T, Bname, Ptitle

X: It is used to store the value of field from the datatable


XL: It is used to store the cell value of column D from excelSheet
Row: Row contains the count of the used row or filled rows in the excelSheet
iRow: iRow is used for searching the row which contains the specified datatable field in
excelSheet
T: T is used for storing the value of the Type column of the datatable
vRow: vRow is used to store the value of the vRow column of the datatable, controls the
flow of the script, It acts as a Handler of the script
vRow = DataTable.Value("vRow", dtGlobalSheet)
DataTable.SetCurrentRow(vRow+1)
T = Datatable.Value("Type", dtglobalSheet)

Stores the value of Column Type of the datatable


If T = "Next" Then
wait 5
Call NextScreen(excelSheet)
vRow = vRow + 1
DataTable.SetCurrentRow(vRow+1)
T = Datatable.Value("Type", dtglobalSheet)
End If

Next is used for identifying the navigated screen and populating the excelSheet with all
the objects and its properties.
When T = Next, NextScreen(excelSheet) function is called.
NextScreen is used for identifying the navigated screen and populating the excelSheet
with all the objects and its properties.

Page 7

1/25/2015

258322243.doc

NextScreen function has been discussed in detail later.


If T = "CheckPoint" Then
Dim oinf, inf
inf = DataTable.Value("Otherinfo", dtglobalSheet)
oinf = Split(inf, ",", -1, 1)
Call Common (excelSheet, oinf(0), oinf(0), "WebElement", oinf(1))
Row = excelSheet.UsedRange.Rows.Count
End If

For T = Checkpoint, Otherinfo field in the datatable of the script provides the browser
name and the html tag of the Web Element which needs to be checked.
Browser Name and HTML Tag is retrieved using the split command where the
delimiter/splitter is ,
This browser name and HTML tag along with the Page Title* is passed in the common
function.
*Page Title is same as browser name in the current application. If it changes then
Otherinfo will have Browser Name, Page Title, HTML Tag. Arguments in the Common
Function will be changed to the following in the above case.
Call Common (excelSheet, oinf(0), oinf(1), "WebElement", oinf(2))
XL = excelSheet.Cells(iRow, "D")
Do Until (X = XL or iRow = Row)
iRow = iRow + 1
XL = excelSheet.Cells(iRow, "D")
Loop

Initially iRow=2
Keep iterating, until X=XL or iRow=Row ie keep iterating through the loop until the field
value from datatable is matched with that of the excelSheet or iRow is equal to the last
row count of the excel sheet.
Increment iRow value by one in each iteration.
Exit from the loop gives the row no containing the field
Datatable.Value("Browser", dtglobalSheet) = excelSheet.Cells(iRow, "A")

Get the Browser name on the Row Number as iRow


If excelSheet.Cells(iRow, "C") = "WebList" Then
Prp = excelSheet.Cells(iRow, "F")
End If

If the column C of iRow is WebList,


Store the value of column F of iRow into variable Prp

Page 8

1/25/2015

258322243.doc
If excelSheet.Cells(iRow, "C") = "WebEdit" Then
If DataTable.Value("Otherinfo", dtGlobalSheet) = "Check" Then
Prp = excelSheet.Cells(iRow, "G")
Else
Prp = excelSheet.Cells(iRow, "F")
End if
End If

If the column C of iRow is WebEdit


Validate the value of Otherinfo in datatable if the value is Check then store the value of
column G of iRow into variable Prp else store the value of column F of iRow into
variable Prp.
If excelSheet.Cells(iRow, "C") = "Image" Then
Prp = excelSheet.Cells(iRow, "F")
End If

If the column C of iRow is Image


Store the value of column F of iRow into variable Prp
If excelSheet.Cells(iRow, "C") = "WebRadioGroup" Then
MyString = excelSheet.Cells(iRow, "F")
Prp = MyString
End if

If the column C of iRow is WebRadioGroup


Store the value of column F of iRow into variable Prp

If excelSheet.Cells(iRow, "C") = "Link" Then


Prp = excelSheet.Cells(iRow, "E")
End If
If excelSheet.Cells(iRow, "C") = "WebElement" Then
Prp = excelSheet.Cells(iRow, "G")
Call ClearCell(excelSheet, "WebElement")
End If
If excelSheet.Cells(iRow, "C") = "WebCheckBox" Then
Prp = excelSheet.Cells(iRow, "F")
End If
If excelSheet.Cells(iRow, "C") = "WebTable" Then
Prp = excelSheet.Cells(iRow, "F")
End If

Similarly for other controls


Search = Prp
vRow = vRow + 1

Page 9

1/25/2015

258322243.doc
DataTable.Value("vRow", dtGlobalSheet) = vRow

Finally the function returns the value in Prp


Increment the value of vRow

3.) NextScreen Function


Use:
NextScreen Function identifies the navigated screen and populates the excelSheet (kept at
the local drive) with the objects and its properties.

Arguments
excelSheet: The existing excelsheet in C: drive

Code and Explanation


Variables
Dim screenval, z, html, Row
screenval = Array("WebList", "WebCheckBox", WebRadioGroup", "WebEdit",
"WebButton", "Image", "Link", "WebTable")

Screenval: Screenval is an array containing Web Class.


z = Ubound(screenval)

z: z contains the upperbound of the array Screenval


Bname = DataTable.Value("Browser", dtglobalSheet)
Ptitle = DataTable.Value("Browser", dtglobalSheet)
For y = 0 to z
html = ""
Call Common (excelSheet, Bname, Ptitle, screenval(y), html)
Next

For each Web Class in the screenval


Function common is called to fetch the values of the desired properties of the navigated
page.
Value of html for all above mentioned class is blank.
Arguments of function Common
Call Common (excelSheet object, Browser name, Page title, Class, html tag)

Page 10

1/25/2015

258322243.doc

4.) CommonTable Function


Use:
CommonTable Function has same functionality as function Common except that this
function is exclusively used to handle WebTable and its child objects which again can be
any of the classes.

Arguments
CommonTable Function has the following six arguments
1. excelSheet: The existing sheet in C drive
2. snameBrowser: The name of the Browser
3. stitlePage: The Title of the Page
4. val: The html id of WebTable
5. val2: micclass
6. val3:value of html tag

Code
Public Function CommonTable(excelSheet, snameBrowser, stitlePage, val, val2, val3)
Dim arr1, var2, tempValue,arr2, arr3
Set Obj=Description.create()
Dim MyString, MyArray, Msg,No
If val2 = "WebElement" Then
Obj("micclass").Value = val2
Obj("html tag").Value = val3
Set List=Browser("name:="&snameBrowser).Page("title:="&stitlePage).WebTable("html
id:="&val).ChildObjects(Obj)
objcount=List.count()
rowCount = excelSheet.UsedRange.Rows.count
For j=0 to objcount-1
excelSheet.Cells(rowCount + 1 , "A") = snameBrowser
excelSheet.Cells(rowCount + 1 , "B") = stitlePage
If val3 = "SPAN" Then
arr2=List(j).GetROProperty("html id")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "D") = arr2
excelSheet.Cells(rowCount + 1 , "C") = val2
arr1=List(j).GetROProperty("innerText")
excelSheet.Cells(rowCount + 1 , "G") = arr1
excelSheet.Cells(rowCount + 1 , "H") = "WebTable"
rowCount = rowCount + 1
Else
arr2=List(j).GetROProperty("innerhtml")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "D") = arr2
excelSheet.Cells(rowCount + 1 , "C") = val2
arr1=List(j).GetROProperty("innerText")
excelSheet.Cells(rowCount + 1 , "G") = arr1
excelSheet.Cells(rowCount + 1 , "H") = "WebTable"
rowCount = rowCount + 1

Page 11

1/25/2015

258322243.doc
End if
Next
Else
Obj("micclass").Value = val2
Set List=Browser("name:="&snameBrowser).Page("title:="&stitlePage).WebTable("html
id:="&val).ChildObjects(Obj)
objcount=List.count()
rowCount = excelSheet.UsedRange.Rows.count
For j=0 to objcount-1
arr1=List(j).GetROProperty("Name")
excelSheet.Cells(rowCount + 1 , "E") = arr1
MyArray = Split(arr1, "$", -1, 1)
No=Ubound(MyArray)
excelSheet.Cells(rowCount + 1 , "D") = MyArray(No)
excelSheet.Cells(rowCount + 1 , "A") = snameBrowser
excelSheet.Cells(rowCount + 1 , "B") = stitlePage
arr2=List(j).GetROProperty("html id")
excelSheet.Cells(rowCount + 1 , "F") = arr2
excelSheet.Cells(rowCount + 1 , "C") = val2
arr3=List(j).GetROProperty("value")
excelSheet.Cells(rowCount + 1 , "G") = arr3
excelSheet.Cells(rowCount + 1 , "H") = "WebTable"
If val2 = "Image" Then
arr2=List(j).GetROProperty("alt")
excelSheet.Cells(rowCount + 1 , "F") = arr2
End If
If val2 = "WebRadioGroup" Then
arr2=List(j).GetROProperty("value")
excelSheet.Cells(rowCount + 1 , "G") = arr2
End If
rowCount = rowCount + 1
Next
End if

End Function

5.) SearchTable Function


Use
SearchTable Function has similar functionality as that of Search function except that the
function is exclusively used to search child objects within a WebTable, which can contain
any Class.

Arguments
Search Table as 2 arguments namely
1. excelSheet: The existing Excelsheet in C:drive
2. htmlid_Table: The html id of the WebTable

Page 12

1/25/2015

258322243.doc

Code
Function SearchTable (excelSheet, htmlid_Table)
Dim X, XL, Row, iRow , xRow, T, Bname, Ptitle, YL
vRow = DataTable.Value("vRow", dtGlobalSheet)
DataTable.SetCurrentRow(vRow+1)
T = Datatable.Value("Type", dtglobalSheet)
X = Datatable.Value("Field", dtglobalSheet)
Row = excelSheet.UsedRange.Rows.Count
iRow = 2
If T = "CheckPoint" Then
Dim oinf, inf
inf = DataTable.Value("Otherinfo", dtglobalSheet)
oinf = Split(inf, ",", -1, 1)
Call CommonTable (excelSheet, oinf(0), oinf(0), htmlid_Table, "WebElement", oinf(1))
Row = excelSheet.UsedRange.Rows.Count
End If
XL = excelSheet.Cells(iRow, "D")
YL = excelSheet.Cells(iRow, "H")
Do Until ((X = XL and YL = "WebTable") or iRow = Row)
iRow = iRow + 1
XL = excelSheet.Cells(iRow, "D")
YL = excelSheet.Cells(iRow, "H")
Loop
Datatable.Value("Browser", dtglobalSheet) = excelSheet.Cells(iRow, "A")
If excelSheet.Cells(iRow, "C") = "WebList" Then
Prp = excelSheet.Cells(iRow, "F")
End If
If excelSheet.Cells(iRow, "C") = "WebEdit" Then
If DataTable.Value("Otherinfo", dtGlobalSheet) = "Check" Then
Prp = excelSheet.Cells(iRow, "G")
Else
Prp = excelSheet.Cells(iRow, "F")
End if
End If
If excelSheet.Cells(iRow, "C") = "Image" Then
Prp = excelSheet.Cells(iRow, "F")
End If
If excelSheet.Cells(iRow, "C") = "WebRadioGroup" Then
MyString = excelSheet.Cells(iRow, "F")
'Keeping the code for future use
'
'
'
'
'
'
'
'
'
'
'
'
'

dim MyArray, Msg,No


MyArray = Split(MyString, "_", -1, 1)
No=Ubound(MyArray)
Msg= MyArray(No)
result=""
For i=0 to No - 1
If i=No-1 Then
result = result +MyArray(i) +".*"
else
result = result +MyArray(i)+"_"
End If
Next
Prp=result

Page 13

1/25/2015

258322243.doc

Prp = MyString
End If
If excelSheet.Cells(iRow, "C") = "Link" Then
Prp = excelSheet.Cells(iRow, "E")
End If
If excelSheet.Cells(iRow, "C") = "WebElement" Then
Prp = excelSheet.Cells(iRow, "G")
Call ClearCell(excelSheet, "WebElement")
End If
If excelSheet.Cells(iRow, "C") = "WebCheckBox" Then
Prp = excelSheet.Cells(iRow, "F")
End If
SearchTable = Prp
vRow = vRow + 1
DataTable.Value("vRow", dtGlobalSheet) = vRow
End Function

6.) ClearCell Function


Use
ClearCell function clears the added row in the excelSheet where class is WebElements

Arguments
excelSheet: The existing Excelsheet in C:drive

Code
Function ClearCell (excelSheet, val)
Dim Row, iRow
Row = excelSheet.UsedRange.Rows.Count
For iRow = Row to 2 Step -1
If excelSheet.Cells(iRow, "C") = val Then
excelSheet.Cells(iRow, "C").EntireRow.Delete
End If
Next
End Function

Page 14

1/25/2015

258322243.doc

Main Script
Dim excelSheet
Set ExcelApp = CreateObject("Excel.Application")
Set NewWorkbook = ExcelApp.Workbooks.Open("C:/CaptureProperties_page.xls")
Set OpenWorkbook = NewWorkbook
ExcelApp.Visible = True
Set excelSheet = ExcelApp.ActiveSheet
ExcelApp.Visible = True
Dim cnt, iter, i, bname, pname
cnt = DataTable.GetRowCount
For iter = 1 to cnt +1
If (DataTable.Value("Type", dtGlobalSheet) = "Static" or DataTable.Value("Type",
dtGlobalSheet) = "Capture") Then
If DataTable.Value("Type", dtGlobalSheet) = "Static" Then
bname = DataTable.Value("Browser", dtglobalSheet)
pname = DataTable.Value("Browser", dtglobalSheet)
DataTable.Value("vRow", dtGlobalSheet) = i
vRow = DataTable.Value("vRow", dtGlobalSheet)
DataTable.SetCurrentRow(vRow+1)
Datatable.Value("Value", dtglobalSheet) = Browser("name:=Home Insurance
Quote").Dialog("text:=Microsoft Internet
Explorer").WinRadioButton("text:=OK").GetROProperty("attached text")
Browser("name:="&bname).Dialog("text:=Microsoft Internet
Explorer").WinRadioButton("text:=OK").Click
vRow = vRow + 1
DataTable.Value("vRow", dtGlobalSheet) = vRow
DataTable.SetCurrentRow(vRow+1)
DataTable.Value("vRow", dtGlobalSheet) = vRow
End If
If DataTable.Value("Type", dtGlobalSheet) = "Capture" Then
DataTable.Value("vRow", dtGlobalSheet) = i
vRow = DataTable.Value("vRow", dtGlobalSheet)
DataTable.SetCurrentRow(vRow)
temp = DataTable.Value("Value", dtGlobalSheet)
DataTable.SetCurrentRow(1)
DataTable.Value("Value", dtGlobalSheet) = temp
vRow = vRow + 1
DataTable.Value("vRow", dtGlobalSheet) = vRow
DataTable.SetCurrentRow(vRow+1)
DataTable.Value("vRow", dtGlobalSheet) = vRow
End If
Else
i = Search(excelSheet)
bname = DataTable.Value("Browser", dtglobalSheet)
pname = DataTable.Value("Browser", dtglobalSheet)
If DataTable.Value("Type", dtGlobalSheet) = "CheckPoint" Then
Datatable.Value("Value", dtglobalSheet) = i
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebList" Then

Page 15

1/25/2015

258322243.doc
Browser("name:="&bname).Page("title:="&pname).WebList("html id:="&i).Select
Datatable.Value("Value", dtGlobalSheet)
End If
If DataTable.Value("Type", dtGlobalSheet) = "WebEdit" Then
If DataTable.Value("Otherinfo", dtGlobalSheet) = "Check" Then
Datatable.Value("Value", dtGlobalSheet) = i
Else
Browser("name:="&bname).Page("title:="&pname).WebEdit("html id:="&i).Set
Datatable.Value("Value", dtGlobalSheet)
End if
End if
If DataTable.Value("Type", dtGlobalSheet) = "Image" Then
Browser("name:="&bname).Page("title:="&pname).Image("html id:="&i).click
wait 10
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebRadioGroup" Then
Browser("name:="&bname).Page("title:="&pname).WebRadioGroup("html
id:="&i).Select Datatable.Value("Value", dtGlobalSheet)
End if
If DataTable.Value("Type", dtGlobalSheet) = "Link" Then
Browser("name:="&bname).Page("title:="&pname).Link("name:="&i).Click
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebCheckBox" Then
Browser("name:="&bname).Page("title:="&pname).WebCheckBox("html id:="&i).Set
Datatable.Value("Value", dtGlobalSheet)
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebTable" Then
Dim oinf1, inf1
inf1 = DataTable.Value("Otherinfo", dtglobalSheet)
oinf1 = Split(inf1, ",", -1, 1)
Call CommonTable(excelSheet, bname, pname, i, oinf1(0),oinf1(1))
j = SearchTable(excelSheet, i)
If DataTable.Value("Type", dtGlobalSheet) = "CheckPoint" Then
Datatable.Value("Value", dtglobalSheet) = j
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebList" Then
Browser("name:="&bname).Page("title:="&pname).WebTable("html
id:="&i).WebList("html id:="&j).Select Datatable.Value("Value", dtGlobalSheet)
End If
If DataTable.Value("Type", dtGlobalSheet) = "WebEdit" Then
If DataTable.Value("Otherinfo", dtGlobalSheet) = "Check" Then
Datatable.Value("Value", dtGlobalSheet) = j
Else
Browser("name:="&bname).Page("title:="&pname).WebTable("html id:="&i).WebEdit("html
id:="&j).Set Datatable.Value("Value", dtGlobalSheet)
End if
End if
If DataTable.Value("Type", dtGlobalSheet) = "Image" Then
Browser("name:="&bname).Page("title:="&pname).WebTable("html
id:="&i).Image("alt:="&j).click
wait 10

Page 16

1/25/2015

258322243.doc
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebRadioGroup" Then
Browser("name:="&bname).Page("title:="&pname).WebTable("html
id:="&i).WebRadioGroup("html id:="&j).Select Datatable.Value("Value", dtGlobalSheet)
End if
If DataTable.Value("Type", dtGlobalSheet) = "Link" Then
Browser("name:="&bname).Page("title:="&pname).Link("name:="&j).Click
End if
If DataTable.Value("Type", dtGlobalSheet) = "WebCheckBox" Then
Browser("name:="&bname).Page("title:="&pname).WebTable("html
id:="&i).WebCheckBox("html id:="&j).Set Datatable.Value("Value", dtGlobalSheet)
End if
End if
End if
Next

Page 17

1/25/2015

Potrebbero piacerti anche