Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DP Encapsulation Within Class Object
#1
Solved: 6 Years, 3 Weeks ago
First post so hopefully this makes sense.

I've been given my first tasks within UFT having moved into a new role (previous experience was mainly using VBA and SQL within the Excel Environment, so have an understanding of classe module objects within the VBA Structure).

I'm keen to use the descriptive programming concept within the cases being designed so we can encapsulate the object recognition in the class itself, not sure if this is doable though.

Code:
option explicit

Function ApplicationClassCreation
   ApplicationClassCreation = new Application
End Function

Class Application
    
    Public Window
    
    Sub Initialise
        
        Set SPICEWindow = Description.Create
        Window("Class") = "SwfWindow"
        Window("swfname") = "ShellUI"
        Window("regexpwndtitle") = "SPICE (Environment: Syst)"
        Window("is owned window") = False
        Window("is child window") = False
  
    End  sub
    
    
End Class

The above is an extract of the external function library being used to host the class code.

The structure of the program is:
  -High Level Test Script (which loads)
      - Pre Processing Function Library (Which sets up various file paths according to the local install of the git directory, which also loads)
          - Application Class
The application class once instantiated in the Pre Processing Function Library is then passed back up to high level test script for use.
I was then calling the Initialisation routine from the high level test script thinking this would create the window object that I could reference from the class object, but none of these lines of code work.

Hoping someone can shed some light on this and if what I'm doing is possible within UFT.

Thanks.
Reply


Messages In This Thread
DP Encapsulation Within Class Object - by TheGlovner - 10-10-2018, 08:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,113 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,426 03-11-2014, 12:13 PM
Last Post: devarapallliramana
  can class be a variable in DP wyrdo 1 2,454 08-07-2013, 01:33 PM
Last Post: anil2u
Sad QTP Script | how to get object of some open window just using its class type,Java sophia.sabir 1 8,841 08-07-2013, 01:26 PM
Last Post: anil2u
  Use of Class Concept in QTP sshukla12 6 15,036 12-23-2011, 03:44 PM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 1 Guest(s)