ContributionsMost RecentMost LikesSolutionsRe: TestComplete on Unexpected Window handler not working Hi Alex, Thanks for your reply. I work with the OP who is off today so I am going to answer in his place to help us get to the bottom of this :-). So, your example of " if test code entered wrong data into a form field and this caused display of modal warning window and test code tries then to click the OK button on a form, the click will be blocked because of the modal window" is exactly what is happening. You say however that "an OnUnexpectedWindow event will be triggered". Ok, so that is following with the documentation we see in a link like this: https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/unexpected-windows.html where it says that TC waits until the auto-wait timeout period expires, then fires OnUnexpectedWindow. What we are really curious about is why step 3 on that page is not happening, where if the window is not closed by the handler, then TC goes through a series of steps to close the modal - pressing ESC key, pressing ENTER key, sending close command to the window. We can't seem to get this behaviour to happen - right now if a modal pops up and we do not have a handler for it it is just failing our test because TC is never closing the window. We have an understanding from the docs that TC can and will handle these modals without us having to specifically code for them....? We have used TestComplete for 6 or 7 years now and are on our second iteration of creating tests for our application. We cannot now, nor have we been able to in the past, get the automatic handling of unexpected windows to happen. Our previous GUI test code we coded some special handling for all unexpecteds, but this time around would like to see if we can get TC to handle it and save us some of the work involved. Re: BDD Step Reuse Froglogic , according to this blog posting. See the final section titled 'Use same step definition for different step types'... https://www.froglogic.com/blog/design-good-bdd-steps/ Re: BDD Step Reuse Thanks Alex, That solution you proposed is what we are doing already. Yep, it works, so I have accepted as a solution. But it gives us some bloat - instead of two methods, just the Given and When steps, I now have 3 - the Given, the When and the login method. If I have a lot of step reuse that results in a lot of extra methods. We were just hoping TestComplete BDD had support for one step calling another step, or step binding based on everything but the keywords as some other BDD frameworks do. Thanks all! Re: BDD - Enhance step definition generation Thank you - I hadn't noticed that up there :smileywink: BDD Step Reuse Hi, Anyone have any ideas or suggestions for reusing 2 BDD steps that differ only in their keyword? Given I log in as John Smith When I log in as John Smith Would really love this to be either a single step (can I wildcard the Given or When keywords?!) or two steps but one step calls the other: Given ("I log in as John Smith", function () { // login code here }); When ("I log in as John Smith", function () { // call the Given here, as it already has the necessary code implemented }); Some BDD libraries also offer a generic 'Step' keyword which matches any step type, but I don't believe TestComplete supports it. Any help/suggestions greatly appreciated! Trying our best to prevent massive code bloat. SolvedRe: BDD - Enhance step definition generation I second this request.