Forum Discussion

ucuber's avatar
ucuber
Occasional Contributor
6 years ago
Solved

Looking into IDispatchWrapper-Objects

Hi *,

 

how can I look into a IDispatchWrapper-Object (and also the famous SafeArrayWrapper) to find out what properties and/or methods it supports?

 

Regards

 

Ulrich

  • ucuber's avatar
    ucuber
    6 years ago

    Hi Alex,

     

    right, wie use the QuerySelector methods provided by TC. They work fine. And they give back these wrapper objects where up to now I did not find a pythonis way to look into them - just becaus they are a kind of com objects coming form the language TC was written in.

     

    So as far as I see I have to try with the DOM object definition and then coding a try and arroe method to identify the DOM object behind the wrapper. Not very elegant but I think it is the only way. What I was dreaming of was a kind of dict-method as known from python to get a api information, but ...

     

    Regards

     

    Ulrich

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Ulrich,

     

    Any more details please?

    Is this somehow related to TestComplete?

     

    • ucuber's avatar
      ucuber
      Occasional Contributor

      Hi Alex,

       

      most of the time we use CSS selectors for accessing webelement. We like it more than the NameMapping, especially because we have a lot of dynamic elements.  As it can be seen in the posts before we use python to do the work, what works very well

       

      When we access a WebElement there often comes a SavaArrayWrapper or DispatchWrapper object. I've read a lot of stoff about it and did a lot of dir-ing into the objects. But up to now I did not find a way to analyse the api of such an object related to the attributes or methods they wrap. So it is a lot of try and error, what is a little bit frustrating - ok, very frustrating ;-)

       

      So if you or anyone has an idea how to identify the wrapped apis of the objects I would be more than happy.

       

      Regards

       

      Ulrich

       

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Ulrich,

         

        Some example will help... but my current guess is that you are talking about .QuerySelector() and .QuerySelectorAll() methods provided by TestComplete.

        I did not use them (and this seems to be not mentioned in the documentation), but I think that they behave exactly like the .EvaluateXPath() and .FindChildByXPath() methods. I.e.: if the found web element can be matched to the object from the Object Browser, then the matched object is returned. Otherwise, native DOM element is returned.

        If the above is correct, then the objects that you are talking about should be either native objects/interfaces provided by the given web elements (and thus you should read relevant DOM documentation) or are provided by Python itself (and thus should be addressed in Python's docs). Though I really doubt about latter and tend to think that this is something from the native DOM area...