SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Apr 2012
    Location
    India
    Posts
    136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Executing class methods in qfl!

    Hi,

    I'm trying to pull in all the code written in my framework's vbs files to qfl so as to have the control of the execution
    So, to some extent i'm able to move all the logic and code snippets to the qfl's and tackle it accordingly as per my requirements. But there are some class methods that are getting created initially when the execution starts(the vbs files contain classes and methods which get executed initially) and i'm therefore failing to get them in the qfl's.
    There are certain methods which do the reporting in the vbs file classes which i'm not able to get it in my qfl piece.
    For eg. if i say click here->verify this->if pass->then create an object of class access its method which will then do the reporting.
    I'm not sure i'm able to explain this properly....but need ur comments/queries for the same.

    Let me know if i have confused you in anyway.

    Thanks,
    Ravi.
    Regards,
    Ravi Salunkhe

  2. #2
    Advanced Member
    Join Date
    May 2007
    Posts
    609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    I'm not entirely sure what the issue is but, I have a bit of advice that might help. You cannot put the definition of a class into a .qfl file and then create an instance of that class in your main script. You should create a function, in the .qfl library, that creates an instance of the class and returns it to the script.
    Dennis Belew

  3. #3
    Member
    Join Date
    Mar 2012
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    I am not sure are you trying to pull in the Class_Initialize and Class_Terminate events inside your qfl.
    You can try creating the object instance inside your qfl.
    Your requirement is not very clear though

  4. #4
    Member
    Join Date
    Apr 2012
    Location
    India
    Posts
    136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Hi Folks,

    First of all thanks for your comments(belewda & shreejit).

    Well say if i have a class named Class Ravi() wherein i have some set of functions and variables defined. How can i possibly create an instance of it in a .qfl file. As of now, i first happen to run the vbs's wherein i had these classes defined and then i try to pull them in and create the objects of it. But i'm not sure how do i create a class instance in qfl, do i have some command for it...like the one i had it for vbs(executefile)or so.

    Or can anyone tell me how to create a class instance in qfl...any code snippet would be of much help!

    Thanks,
    Ravi Salunkhe.
    Regards,
    Ravi Salunkhe

  5. #5
    Member
    Join Date
    Mar 2012
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Set obj = new ClassName
    Class ClassName


    End Class
    Try this instantiation as the first line of the qfl file

  6. #6
    Advanced Member
    Join Date
    May 2007
    Posts
    609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Shreejit is correct. That is the way to instantiate the class. If you want to use an isntance of the class in your script, with the definition in the library, there are 2 ways to do it (that I know of).

    1) Use a global variable in the library and set it to an instance of the class, as Shreejit does above.

    2) Create a function that returns an instance of the class.
    Put this in the library with your class:
    <font class="small">Code:</font><hr /><pre>
    public function NewClassName
    Set NewClassName = new ClassName
    end function

    class ClassName
    ' methods and properties
    end Class
    </pre><hr />
    In your script, you would do this:
    <font class="small">Code:</font><hr /><pre>
    Set classInstance = NewClassName()
    </pre><hr />
    Dennis Belew

  7. #7
    Member
    Join Date
    Apr 2012
    Location
    India
    Posts
    136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Hey Guys,

    I'm through with this....still no success!

    Thanks,
    Ravi Salunkhe
    Regards,
    Ravi Salunkhe

  8. #8
    Member
    Join Date
    Mar 2012
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    @Ravi - Please share your code so that we can understand the problem

  9. #9
    Member
    Join Date
    Apr 2012
    Location
    India
    Posts
    136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Hey Shreejit,

    Will mail you the code details for your analysis.

    Thanks for helping.

    Regards,
    Ravi Salunkhe
    Regards,
    Ravi Salunkhe

  10. #10
    Member
    Join Date
    Sep 2010
    Location
    TN, India
    Posts
    377
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Executing class methods in qfl!

    Hi ravi,

    Execute your VBS file which have your classes in global name space. Check ExecuteGlobal function in vbscript.

    Thanks...
    Thank/Like to help others if my input helped you !!!
    I am speaking for myself, not for my employer nor any one.
    Automation Ecstasy

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:05 PM.

Copyright BetaSoft Inc.