Is there a way to handle popups during playback using Sahi Pro without each popup opening its own controller window? - sahi

I'm testing a list of links using Sahi Pro, and each link opens a popup window in which I have to assert that a few elements are available. I'm able to use _closeWindow to get rid of each popup, but I've noticed that every time a new popup loads, it opens a new Sahi controller window to execute the script within that popup. These controller windows do not close when the popups close. Before long there are so many open controller windows that test execution freezes.
Is there a way to close these controller windows programatically? Or to prevent a new one from accompanying each popup in the first place?

This can be avoided by running scripts as test suites from the command line.

Related

Protractor - Changing the target window

I need my automation to open new tab for each describe tests.
To do so, I open a new chrome tab in the beginning of each describe, enter the wanted URL, switching back to the first tab and closes him.
openNewTab()
switchTab()
browser.close()
It works fine, but when I run it - it says that "no such window target window already closed" after it closes the first chrome tab.
I assume that it happens because the automation recognize only the first chrome tab as the "target window" (and there is the session that runs).
How can I handle it?

Close pop up windows that rises during powershell script execution

I'm new with powershell and I'm trying to execute a third party program from command line. In one of the executions path, suddenly a pop up window emerges and the script is paused until I click on the accept button or close that window.
What I need is to avoid that click.
Is it possible to tell the script to close any emerging window or to send an event to close it?
Those windows that suddenly pop up make it impossible for me to achieve my task... Is there any other way to handle this?

How to handle chrome windows that pop up

So in my scenario i am click on some button:
val button = driver.findElement(By.xpath("...."))
button.click
So my problem is that after this click google chrome pop up little windows that i need to confirm and since this not part of the HTML i cannot reach this window, also i am working on MAC so there is no AutoIt that can catch this window.
Any suggestions how to click on this window button ?

tinyMce function to determine if popup is already open

With tinyMce, I've got onclick code to open a plugin using this:
ed.windowManager.open(...)
Right now, it will open a 2nd, 3rd, etc. instance of this plugin window each time I click the target.
Instead, I want the onclick code to ignore the click if the window is already open. How can I detect the open window.
Here's the solution I'm going with:
I seem to have confirmed:
-- that windowManager.open() does not return a reference to the window the same way that window.open() does
-- windowManager does not have a built-in way to limit the number of instances that can be opened.
But it does have a way to add an onClose function to the plugin window:
ed.windowManager.onClose.add(function() {alert('Closing!');});
So I'll be using a variable in the onClick code to keep track of whether the popup window has been opened and closed. The onClose function will mark that variable as closed

Keep modal window open when folderbrowser closes

I have a main Windows form which launches a modal dialog to get some configuration values which are paths.
From the modal window I launch a folderBrowser (wanting to do it for each path to be configured).
When the folderBrowser closes the modal window that launched it closes too.
This means that the user has to open the folderBrowser for each configuration setting rather than just once.
Why is the modal configuration window closing and how can I keep it open until the user has set all the parameter values?
Thanks
Ok, I answered my own question.
The trick is to intercept the closing event and test a flag which I set on the condition that all folder values are valid.
If they aren't set e.Cancel = true;