SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Amsterdam, The Netherlands
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Search for object from Delpi

    Hello

    I have a problem.
    I use delphi to control TestComplete.
    I have a program that include the unit tcConnect.

    I start TestComplete from my delphi program,
    catch the process that i needed (iexplore) and than
    i want to search for an object.

    in Delphi ik looklikes something like this:

    procedure Test;
    var
    myProces : OleVariant
    begin
    RunTest('myLog', 'myproject', 'Test.pjs');
    myProces := TestedApps.Items[iAppIndex].Run(); //start IE

    myProces.FindAll('ObjectType', 'Textbox', 5); //This works fine
    end;

    But now i want to do:

    // Specify the sought-for property names
    PropArray := ['ObjectType', 'Enabled'];
    // Specify the sought-for property values
    ValuesArray := ['Textbox', true];

    myProces.FindAll(PropArray, ValuesArray, 5);

    i tried serveral things to get it work, but he never finds the objecs.
    I already used the function VarArrayCreate but the FindAll don't find the objects

    Who can help me to solve the problem.

    i Use Delphi 2006. [ QUOTE ]


    [/ QUOTE ]
    ______________
    Regards,

    Raymond Wiertz
    Quality Assurance

    Furore.com

  2. #2
    Member
    Join Date
    Nov 2007
    Location
    Amsterdam, The Netherlands
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Search for object from Delpi

    Nobody, am i the only one?
    ______________
    Regards,

    Raymond Wiertz
    Quality Assurance

    Furore.com

  3. #3
    Senior Member
    Join Date
    May 2004
    Posts
    1,196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Search for object from Delpi

    Hi Raymond,

    You can create arrays in the following way:
    <font class="small">Code:</font><hr /><pre> PropArray := BuiltIn.CreateVariantArray(0, 1);
    PropArray[0] := 'ObjectType';
    PropArray[1] := 'Enabled';

    ValuesArray := BuiltIn.CreateVariantArray(0, 1);
    ValuesArray[0] := 'Textbox';
    ValuesArray[1] := true;</pre><hr />
    Best regards,
    David - SmartBear Support

  4. #4
    Member
    Join Date
    Nov 2007
    Location
    Amsterdam, The Netherlands
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Search for object from Delpi

    David,

    Thanks, it works.

    I didn't try the BuiltIn.CreateVariantArray from TC.
    I only used the Delphi functions.
    ______________
    Regards,

    Raymond Wiertz
    Quality Assurance

    Furore.com

  5. #5
    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: Search for object from Delpi

    You can create dictionary object and use for the purpose..
    Object : Scripting.Dictionary - OLE Object
    Just use methods
    instance.Add(name,value) - to add just like name and value pairs
    instance(name).value -- to get the value of specified property

    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.71%
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 09:56 AM.

Copyright BetaSoft Inc.