Avatar of PBMax
PBMaxFlag for United States of America

asked on 

Object Required in Quick Test Pro VBS Function

I'm using Quick Test Pro 9.5 to automate testing of Oracle Demantra Workflows.  I have a function that checks the log page of a Web Application.  I need to get the last row that matches a certain workflow run.  I pass that workflow name as a parameter and wrote another function to return the row number of the last instance of the workflow in the web table.  I am not checking that the Last Step name is my workflow.  I also need to check to see if the text in the Status column states complete.
When I run the following code the CheckProperties steps error stating Object Required.  Didn't I just set the object in the line above?  When debuggin the objects are assigned but I can't see what the objects are. Is this a debugging problem or a code problem?


Public Sub CheckProcessLog(sWorkflowName)
 
   	Dim oWorkflowTable
	Set oWorkflowTable = Browser("Oracle Demantra Workflow").Page("Processes log").WebTable("PID")
 
	Dim iRow
	iRow = FindLastRowWithCellText(oWorkflowTable, sWorkflowName)
 
	Call DisplayRow(oWorkflowTable, iRow)
 
	Dim oLastStep
	Set oLastStep = oWorkflowTable.ChildItem(iRow, 7, "WebElement", 0) 
	oLastStep.CheckProperty "innerText", sWorkflowName
	
	Dim oStatus
	Set oStatus = oWorkflowTable.ChildItem(iRow, 8, "WebElement", 0) 
	oStatus.CheckProperty "innerText", "Completed"
	
End Sub

Open in new window

Visual Basic ClassicProgrammingVB Script

Avatar of undefined
Last Comment
RobSampson
Avatar of RobSampson
RobSampson
Flag of Australia image

Hi, while you haven't specified which line it errors on, I would suspect that in this line:
Set oWorkflowTable = Browser("Oracle Demantra Workflow").Page("Processes log").WebTable("PID")

it cannot find the Browser object.

The Browser object need to have been defined outside the Sub globally for this procedure to be able to use it.

Rob.
Avatar of PBMax
PBMax
Flag of United States of America image

ASKER

Actually it does.  I can do a .ToString() on that object and get the table.  I can also perform some other methods on the object and get valid data.  I think the issue here(after further investigation) is that the line"Set oLastStep = oWorkflowTable.ChildItem(iRow, 7, "WebElement", 0)" is not getting any WebElement Child Items.  This is curious because when I use ObjectSpy I get that the text that is in the cell is a WebElement.  I don't know how to get the correct micClass so that I can grab the ChildItem.  The debugger isn't sophisticated enough for me to see a parent child tree to see the type of the actual element I need.
Avatar of PBMax
PBMax
Flag of United States of America image

ASKER

Thanks for the continued help.  Doing a little more research and running the code below on the oWorkflowTable object I was able to determine the micclass as being "WebTable - WebElement"  I don't know how to pass in the micclass to the CheckProperty method in order to properly check the object.


Sub ChildObjects_Example(oObject)
 
'The following example retrieves the collection of
'WebElement objects
Dim oObjCollection, NumberOfObjects, oDesc
 
'Create a description object to help retrieve all WebElement objects in a specific page.
Set oDesc = Description.Create()
    oDesc("micclass").Value = "WebElement"
 
'Retrieve all WebElement objects in this page
Set oObjCollection = oObject.ChildObjects(oDesc)
NumberOfObjects = oObjCollection.Count
 
Dim i
For i = 0 To NumberOfObjects - 1
   Print i & ": " & oObjCollection(i).GetROProperty("name") & " - " & oObjCollection(i).GetROProperty("micclass") & " - " & oObjCollection(i).GetROProperty("innerText")
   oObjCollection(i).CaptureBitmap "C:\capture" & i & ".bmp", True
Next
End Sub 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of PBMax
PBMax
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of RobSampson
RobSampson
Flag of Australia image

Hi, that's great.  Well done. I'm sorry I couldn't be of more help.

Rob.
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo