cancel
Showing results for 
Search instead for 
Did you mean: 

Extend TestComplete for a different clicky event

SOLVED
Highlighted
Super Contributor

Extend TestComplete for a different clicky event

Consider this line of code.

 

Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry.Click();

 

I have an object in name mapping that I click. Loverly. 

 

There are many instances that want I really need to have done is

 

Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry.scrollIntoView();
Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry.Click();

 

Pretty easy. But what I want to do, if possible, is extend TestComplete to provide a method, something like NavigatorClick that performs scroll then click since I am going to be using this a LOT. But more to the point, the team I am coaching is going to be using it a LOT. And yah know. Learning new stuff is fun. Also, I have found scrollIntoView sometimes doe snot work. Of course, if I find a mechanism that works better, I want to be able to change it once rather than go everywhere I used this method.

 

Is this even in the realm of the possible? If so, can someone direct me to the place to start? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Extend TestComplete for a different clicky event

Not quite as such, no.  You can't do 

Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry.NavigatorClick()

 

What you CAN do is

 

NavigatorClick(Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry)

 

Look up ScriptExtensions.  You can create a runtime object that would encapsulate that method that would be universally available to all projects without needing to do any kind of shared file libraries.


Robert Martin
[Community Expert Group]
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
Extensions available
3 REPLIES 3
Community Hero

Re: Extend TestComplete for a different clicky event

Hi,

 

It is not possible to add/remove methods/properties to/from built-in TestComplete objects.

 

Possible options:

a) Create common public function and use it;

b) Create Script Extension with the same function;

c) Create a Custom Plugin with the same function again.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Community Hero

Re: Extend TestComplete for a different clicky event

Not quite as such, no.  You can't do 

Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry.NavigatorClick()

 

What you CAN do is

 

NavigatorClick(Aliases.browser.pageMain.wndWindowHeader.panMenuContent.mnuTicketInquiry)

 

Look up ScriptExtensions.  You can create a runtime object that would encapsulate that method that would be universally available to all projects without needing to do any kind of shared file libraries.


Robert Martin
[Community Expert Group]
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
Extensions available
Super Contributor

Re: Extend TestComplete for a different clicky event

Yah I had figured as much. Thanks.

New Here?
Join us and watch the welcome video: