Forum Discussion

JackSparrow's avatar
JackSparrow
Frequent Contributor
8 years ago

descriptive programming with Python

Hi All ,

 

  • Am new to test complete till now because of your little push i learned so many things in test complete, now its time to take next step.
  • How to write a descriptive programming in test complete with python, actually i know how to do with VB scripting but i want to know how we do in python.
  • It will be great if any one just show/explain me an example for a desktop application.

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero

     

    As far as I know, descriptive coding is just a kind of interacting with application objects without calling them from the object repository. 

     

    This can be implemented in different ways. For example:

     

    app = Sys.Process("calc") #Windows calculator

    class Button: def __init__(self, caption): self.button = app.Find(['WndClass', 'WndCaption'],
    ['Button', caption], 10) def click(self): self.button.Click() class Keypad: def __init__(self): self.btn0 = Button(0) self.btn1 = Button(1) self.btn2 = Button(2) self.btn3 = Button(3) self.btn4 = Button(4) self.btn5 = Button(5) self.btn6 = Button(6) self.btn7 = Button(7) self.btn8 = Button(8) self.btn9 = Button(9) def test(): keypad = Keypad() keypad.btn5.click() keypad.btn7.click() keypad.btn0.click()

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    As I understand it, Descriptive Programming is a QTP/UFT concept that TestComplete parallels in it's use of Aliases, NameMapping, FindChild, etc.  I'm not sure that there is an exact 1 to 1 method to do what QTP/UFT does in descriptive programming.