Showing results for 
Search instead for 
Did you mean: 

Custom event

Occasional Contributor

Custom event

Can I assign a custom event ?


I have an input process that spans a couple of screens, I have written a test case for every step (so that we run any steps needed)


Now the developer has added a confirmation box at every step


I can add a test for this at the end of every script but is there another way ?




script: if script = "Steps_*" then run "check_confirmation"


I realize that I can just add a function call at the end 10 scripts, but say it was 1000 + different step scattered over my Project or ProjectSuit



Tags (1)
Community Hero

Re: Custom event

See if this helps


function GeneralEvents_OnStartTest(Sender)
  if (Project.TestItems.Current.Name == "FirstTestItem")
    // Do something

Occasional Contributor

Re: Custom event

This would only happen once, I am looking for is to trigger on any script













I would like any event to trigger on every bc script



  on "*bc*" test if (input = 3)


Community Hero

Re: Custom event

@AlexKaras Isn't there a way to wrap the main script in an event handler and have it happen for each of the child scripts?  

Community Hero

Re: Custom event



Without knowing any details about tested application, this is my personal opinion:

a) It is not a big deal to add one function call in ten places. Also this might be a good reason to refactor existing code. For example, replace the click over the 'Next' button with the call to, say, proceedNext() function. In this function perform click on the button and check if confirmation window appears. Handle it if it appears;

b) Depending on the type of tested application and notification window: you may consider OnUnexpectedWindow event that will trigger for desktop application if test code tries to interact (click, activate, set focus) with UI element that is blocked by some other window. If this is your case you may just handle this confirmation window within event handler's code.


  /Alex [Community Hero]
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
Occasional Contributor

Re: Custom event



I am suggesting that there are too many scripts to augment and am looking for a wildcard event trigger



test runs successfully


browser now wants an update but am unable to due to security policy


I am looking for a wildcard or regex triggered event

if script = (login.*|.*navigate_to.*) then 

            dismiss update popup

or if event = update popup

            dismiss update popup


not as generic as "OnStartTest"

New Here?
Join us and watch the welcome video:
Top Kudoed Authors