Forum Discussion

gdave's avatar
gdave
Regular Contributor
7 years ago

TomRichEditSearch

Hi all

 

The control I am working on is a pop up window and looks like an HTML version which has text in it. My test is to edit the text value however I do not have access to the text through TestComplete (basicall ObjectSpy doesn't highlight the text within). The WNDCLASS is TomRichEditSearch. I have attached the screen shot of the properties & methods for yuor reference. Can someone please advise how do I go about editing the text ? Thanks

 

 

Regards

G

8 Replies

  • If you're going to be manipulating a DOM object, I think you're going to find it easier to do it through code, as opposed to a Keyword Test.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I agree with will_fetherolf... there may be a better solution to this problem but, based upon what I'm seeing, the contents of your edit control are an XML document of sorts so actually manipulating those contents mean manipulating the XML.  And that is best done in code.  It can be done in KeywordTest... but honestly, it's going to be pretty bulky and ugly.

      • gdave's avatar
        gdave
        Regular Contributor

        Hi

         

        I read the DOM reference link, but frankly, with very very limited knowledge of coding at our end I am struggling to to kick start things here. So any guidance around writing the code around it will be much appreciated, alternatively I wouldn't mind taking the keyword based approach if thats something easy for you all to direct me in the right direction. Thanks

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That is a VERY odd looking component... the "wText" property looks like it contains XML so I'm GUESSING that this is an edit control that somehow does some kind of wrapping/rendering of XML data into something else.  I see a "wSelection" property and a select start and select end which seems to imply that there's some text on the control that is currently selected/highlighted.  So, over all, a rather interesting control.

     

    My suspicion is that you will need to do some odd code here... If you want to edit the text contents, I would say you should grab the contents of wText, convert that into an MSXMl.DOMDocument object, manipulate the nodes, text, etc. using DOMDocument methods and properties, convert that back into text, and set the wText value to that new value.

    • gdave's avatar
      gdave
      Regular Contributor

      tristaanogrewrote:

      That is a VERY odd looking component... the "wText" property looks like it contains XML so I'm GUESSING that this is an edit control that somehow does some kind of wrapping/rendering of XML data into something else.  I see a "wSelection" property and a select start and select end which seems to imply that there's some text on the control that is currently selected/highlighted.  So, over all, a rather interesting control.

       

      My suspicion is that you will need to do some odd code here... If you want to edit the text contents, I would say you should grab the contents of wText, convert that into an MSXMl.DOMDocument object, manipulate the nodes, text, etc. using DOMDocument methods and properties, convert that back into text, and set the wText value to that new value.


      Yes the control text was highlighted by myself at the time of retrieving its properties/methods through ObjectSpy, ideally the value for wSelection End & Start is '0'. Any suggestions/guidance as to how can I do what  you've suggested above ie "convert that into an MSXMl.DOMDocument object, manipulate the nodes, text, etc. using DOMDocument methods and properties, convert that back into text, and set the wText value to that new value." Thanks