0

I know similiar question has been asked previously. Instead of hijacking the question iam raising a new one as that question didnt answer my issue. Here is the code: Iam using Python language

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
 try :
   ParamFactory=CurrentTSTest
   ParamObj=ParamFactory.TestParameterFactory
   ParamAdd=ParamObj.AddItem(None)
   ParamAdd.name="Provider"
   ParamAdd.DefaultValue="XYZ"
   ParamAdd.Description="XYZ Service Provider"
   ParamAdd.Post()
   # clear output window
   TDOutput.Clear()

After executing the , TestParameterFactory is not working. Please can anyone let me know where iam doing wrong.

Error] (L21: c0): Traceback (most recent call last): 
 File "<Script Block >", line 21, in Test_Main 
 ParamObj=ParamFactory.TestParameterFactory 
 File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 516, in _    _getattr__ 
  raise AttributeError("%s.%s" % (self._username_, attr)) 
  AttributeError: <unknown>.TestParameterFactory 

If i use OTA TestParameterFactory works fine. I really appreciate if anyone can point me right direction. I tried all options now. thanks for looking into it

Macintosh_89
  • 664
  • 8
  • 24

1 Answers1

0

Found the answer

this is what you would do ( use "ThisTest" object which is of type TDApiOle80.Test , you can find that pane next (left) to test under Object ( where usually you will see Library,Soap,Java..)

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
  try :
  # clear output window
  TDOutput.Clear()
  ParamObj=ThisTest.TestParameterFactory
  ParamAdd=ParamObj.AddItem(None)
  ParamAdd.name="Provider"
  ParamAdd.DefaultValue="XYZ"
  ParamAdd.Description="XYZ Service Provider"
  ParamAdd.Post()
  TDOutput.Print (ThisTest.HasParam )
Macintosh_89
  • 664
  • 8
  • 24