Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Descriptive PROGRAMMING
#1
Not Solved
Hi All,

I was writing a function to take create objects using descriptive programming. 
I donno where i went wrong, but the object is not getting returned correctly..
Below is the code.. ANyone please help me on this


Public Function fnObjectWithDescriptiveProgram(strObjectMicClass, strObjectProperties)
    On Error Resume Next
    Err.Clear
    
    'Declaring Description Create
    Dim oDesc, DictObjectProperties, strPropertyValues, strProperties
    Set oDesc = Description.Create 
    Set DictObjectProperties = CreateObject("Scripting.Dictionary")
    If strObjectProperties <> "" Then 
        strPropertyValues = SPLIT(strObjectProperties, ",") 
        strProperties = Array("name""html id""html tag""text""innertext""column names""index""alt""image type""file name""all items")
        For itr = 0 To UBOUND(strProperties)
            If strPropertyValues(itr) <> "" Then
                DictObjectProperties.Add strProperties(itr), strPropertyValues(itr)
            End If
        Next
    End If
    
    Select Case UCASE(strObjectMicClass)
        
        Case "BROWSER"
            oDesc("micclass").Value = "Browser"
        
        Case "PAGE"
            oDesc("micclass").Value = "Page"
            
        Case "WEBBUTTON"
            oDesc("micclass").Value = "WebButton"
            oDesc("type").Value = "button"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "WEBEDIT"
            oDesc("micclass").Value = "WebEdit"
            oDesc("type").Value = "text"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "EMAIL"
            oDesc("micclass").Value = "WebEdit"
            oDesc("type").Value = "email"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "PASSWORD"
            oDesc("micclass").Value = "WebEdit"
            oDesc("type").Value = "password"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "WEBELEMENT"
            oDesc("micclass").Value = "WebElement"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "LINK"
            oDesc("micclass").Value = "Link"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "IMAGE"
            oDesc("micclass").Value = "Image"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "WEBCHECKBOX"
            oDesc("micclass").Value = "WebCheckBox"
            oDesc("type").Value = "checkbox"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "WEBRADIOGROUP"
            oDesc("micclass").Value = "WebRadioGroup"
            oDesc("type").Value = "radio"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
            
        Case "WEBLIST"
            oDesc("micclass").Value = "WebList"
            oDesc("select type").Value = "ComboBox Select"
            For each item in DictObjectProperties
                oDesc(item).Value = DictObjectProperties(item)
            Next
        
    End Select
    
    Set fnObjectWithDescriptiveProgram = Description.Create
    fnObjectWithDescriptiveProgram = oDesc
    
End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is this one instance where descriptive programming does not work? chong67 10 6,818 10-09-2012, 06:41 PM
Last Post: harishshenoy
  Descriptive Programming By giving the description in form of the string arguments sia sharma 6 4,868 09-12-2012, 08:57 PM
Last Post: freeboynil
  Can you use Descriptive Programming with Checkpoint? chong67 4 8,376 06-27-2012, 10:29 AM
Last Post: sshukla12
  Can I use Descriptive Programming on Checkpoint? chong67 0 2,138 06-22-2012, 08:34 PM
Last Post: chong67
  General error in Descriptive programming sqadri 3 3,785 04-23-2012, 11:01 AM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 1 Guest(s)