Ask a Question

Search and repalce a specific operation on all KeywordTests

SOLVED
ivan_sy
Contributor

Search and repalce a specific operation on all KeywordTests

We are just using the default TestComplete automatic namemapping during recording and so far we have no problems with it. Our application now has a newer branch, with a support for HTML formmatting on the same spot where the normal textcontrol is - buttom line, it's a new object. I have edited namemapping mapped object to do conditional mode, to support both the old textcontrol and the HTML capable textcontrol and I am happy that it works.



However, the problem now is that most KeywordTests uses the operation SetText() and the newer object doesn't have SetText() but just set_text(). The old object supports both SetText() and set_text() - so it was a poor decision of not using set_text() - well we haven't known that till now.



Is there a way to do a search and replace functionality for all KeywordTests in the project to change all instances of SetText() to set_text() ?

10 REPLIES 10
TanyaYatskovska
SmartBear Alumni (Retired)


Hi Ivan,


 


The set_text method seems to be a custom method of the control while SetText is the one provided by TestComplete. You don't see the SetText action as the control may not have special support in TestComplete. However, it looks like this control is inherited from the one that is supported by the tool. So, you can try using the Object Mapping feature to make TestComplete treat the control as a supported control. In this case, SetText will be available for the controls, and there will be no need to modify the test.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



ivan_sy
Contributor

Hi Tanya.  thank you for pointing that out.



I tried to add the Class using the "Add From Screen", it uses the WndClass value and playing it gave me this error:



Unable to find the object SetText("act"). See Additional Information for details.

The object with the specified attributes does not exist.



Possible causes of the error




I removed that class and added it manually as "TXTextControl.TextControl" (which is the value of ClrFullClassName



There's no error but TestComplete was not able to set the text on it. As I view it while in playback, it does nothing.



The control is documented here:

http://www.textcontrol.com/en_US/support/documentation/dotnet/n_textcontrol.htm



It looks like a richtextbox and it is intended to be an HTML editor, more like a richtextbox but for HTML editing. It also wrapped inside (its parent object) an Infragistics Ultrapanel (if that matters)



What can you advise?
TanyaYatskovska
SmartBear Alumni (Retired)


Hi Ivan,


 


It looks like my suggestion won't work for this control. I suggest that you vote for it on this page - this way, implementing support for your control in one of the future updates will get a higher priority.


 


At the moment, using set_text seems to be the only option. So, you will have to modify the keyword test. I suggest that you do it outside TestComplete by changing the corresponding .tcKDTest  file (TestComplete can search only though the Value column in the Keyword Editor, but you need to change the Operation column).

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



dbattaglia
Contributor

Hi Tanya,



I have a follow up question on this--it sounds like you have already answered it, but I am hoping that you may have suggestions.



We have a project suite that is composed mostly of keyword tests.



If we need to change a keyword operation for an entirely different one, is there an efficient way to accomplish that?



Similary to Ivan's question, how could I find all Delay keyword operations in the project suite and replace them with Run Script Routine operations?



Any suggestions would be appreciated.



Thanks,

Daniel
TanyaYatskovska
SmartBear Alumni (Retired)

Hi Daniel,

 


Right now, TestComplete can search through the Value column in keyword tests. As the Delay command is specified in the Operation column, TC won't find anything there. So, the only option is to modify the .tcKDTest file.


 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



Hey all,

 

@TanyaYatskovska , is there any update since than so i can search through the Operation column in keyword tests?

 

best regards

Kai

@TanyaYatskovska, i push this thread UP

tristaanogre
Esteemed Contributor

PLease submit a feature request if this is something you want to see.  have you downloaded and tried TC 14 just to be sure?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi @tristaanogre ,

 

yes i tryed it with TC14. What i need to do to submit for a feature request?

 

regards

 

Kai

cancel
Showing results for 
Search instead for 
Did you mean: