Prevent new browser window from opening when running Protractor tests - webstorm

I'm using JetBrains Webstorm IDE and set it up to run my Protractor tests from inside, and all the command line output shows nicely in the test runner, but the browser window pops up over everything and I find it extremely distracting. Is there a way to stop it from showing? Or forcing it to stay minimized?

This applies to Karma - but maybe you can do the same thing in Protractor.
My horrible hack for this is to launch Firefox with -with-tab instead of -no-remote and set the Firefox tab loading behaviour by using the info at http://www.techsupportalert.com/content/how-stop-firefox-stealing-window-focus.htm - basically by setting browser.tabs.loadDivertedInBackground to true.
This prevents the window stealing focus when you load a new tab. You end up with a lot of tabs though.

Related

Intellisense autocompletion of expressions to watch in watch window or debug console

Is it possible while debugging, and a breakpoint has been hit, to autocomplete variables in the current scope in the Debug Console or the Watch Window?
An example gif is attached of where I would hope to get some auto-completion suggestions.
Essentially, on typing just long, I would like to autocomplete to work here so that it suggests longish_variable_name that I can then possibly tab complete.
VSCode has, by default, CtrlSpace mapped to triggering autocompletion suggestions, but this only seems to work in the editor window.
Use the variable once in the debug window, and auto-complete will do the rest of the work for you ever after (given the variable name shouldn't be changed, or you need to use it in the debugger console again to get auto-completion suggestion.)
I have a test variable named very_very_long_var — but the debug window didn't suggest anything on the first go. It was presented once I used it the first time in that window.

Opening and testing a sub-window programmatically made in Vaadin, using Vaadin TestBench

Good day, fellow stackoverflow users. I have a problem using Vaadin TestBench in order to test a sub-window.
To be more specific, I've programmed a "popup" window that will be invoked by the main application when such application fails for whatever reason. As this sub-window doesn't have an URL, it will simply be invoked programmatically. I'm having problems coming up with a way of testing this single sub-window, as I have searched and read the Vaadin documentation, but all examples I see involve creating a driver for a certain browser, invoking a URL, accessing its elements and then doing the tests.
All I want is something like this:
Window popup = new Window() // Create sub-window (popup) programmatically
// instead of navigating to an URL with a web driver
// Here, I select the elements of the popup and do actions on it
// programmatically
...
// End the test and close the popup window
popup.close()
Is there a way of accomplishing this feat? I'm using the latest version of Vaadin on Springboot.
Vaadin Testbench and Selenium use the same base. You can reach the popup in the same way you do in Selenium:
driver.switchTo().activeElement();
or (if it is an alert)
driver.switchTo().alert().submit(); //submit = click OK, maybe it differs from your intention
If your "popup" is a separate browser window, you can switch by windowHandle.
driver.switchTo().window();
Hope this helps :)

Postman won't start on Windows 7

I've been using Postman for a while now. Suddenly though it has stopped working. When trying to open it I get a loading spinner then nothing. No error. Nothing in Event Viewer. Nothing. Although the Icon in the task bar at the foot of the page looks broken or corrupted.
I've tried reinstalling, rebooting, clearing cache - nothing
I'm on Windows 7, 64 bit
Anyone ran into anything like this? :-/
I had a similar issue. The solution that worked for me is to use --disable-gpu flag for postman shortcut C:\Users\<username>\AppData\Local\Postman\<app-version>\Postman.exe --disable-gpu:
More info on Github: https://github.com/postmanlabs/postman-app-support/issues/4594
This issue happened for me when running a remote desktop session, it appears that postman is running but opening off screen. According to this thread
https://github.com/postmanlabs/postman-app-support/issues/2833
This can happen when you add or change a monitor.
There is a solution there - deleting some json files - but I found that I could see the Postman app in Task Manager -> Applications and then bring it up by selecting "Switch To"
I faced a similar issue and found that you need to navigate to AppData\Local\Postman and find the latest installed version folder now change the shortcut path on the desktop in my case it was AppData\Local\Postman\app-7.36.0\Postman.exe I did and it worked :)
postman folder
postman desktop shortcut
I had a similar issue on Windows 10. The application did not show up after opening it. This post helped me:
Hover the Postman icon in the taskbar. Then click the preview window that opens above it.
Press Alt + Space and then M or click "Move".
Move the Postman window with arrow keys, it probably was invisible on the right or left side of your screen.
This problem appeared after working with an external display. When I got Postman back visible, it showed an update dialogue.

Can I configure Watin to leave the browser window open when the test completes?

I've just begun trying out WatiN as part of my testing platform for web projects. For ease of setting up tests and also for allowing some "manual" intervention I'd like to set an option so that the browser window remains open when the test completes. I'm using the simple quick start with the following code...
public void Should_start_google()
{
using (var browser = new IE("google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("Hello WatiN");
browser.Button(Find.ByName("btnG")).Click();
}
}
It runs perfectly fine however when its complete the browser shuts down with the test. Is there any way to have the browser window remain open? I think it will be useful for developing my tests.
Thanks,
Justin
You should set the AutoClose property to false.
In your case, you would just need to add the following line:
browser.AutoClose = false;

How do I test modal dialogs with Selenium?

I'm getting started with Selenium IDE and trying to test a webapp that's full of modal dialogs (window.showModalDialog).
Recording the test seems to work (except there's nothing in the log when the dialog pops up) but they don't play back properly. The script actually opens the window (triggered by a button click), but then just waits indefinitely.
Any suggestions?
From the Selenium FAQ, Selenium apparently works with some types of dialogs but not others:
I can't interact with a popup dialog.
My test stops in its tracks!
You can, but only if the dialog is an
alert or confirmation dialog. Other
special dialogs can't be dismissed by
javascript, and thus currently cannot
be interacted with. These include the
"Save File", "Remember this Password"
(Firefox), and modal (IE) dialogs.
When they appear, Selenium can only
wring its hands in despair.
To solve this issue, you may use a
workaround (if one exists); otherwise
you may have to exclude the test from
your automated corpus. For the "Save
File" dialog in Firefox, a custom
template may be specified when running
via the RC that will always cause the
file to be downloaded to a specified
location, without querying the user
(see
http://forums.openqa.org/thread.jspa?messageID=31350).
The "Remember this Password" dialog
should not appear again after you've
chosen to remember it. Currently there
is not much that can be done about IE
modal dialogs.
I seem to remember someone working around this with an AutoHotKey script that dismissed the dialog.
I have been using Selenium IDE to test jQuery modals for quite sometime now, I never faced any problem. Here are the things I do to ensure that the test executes properly on playback:
execute the script at the slowest possible speed
when the modal opens, I use the waitForElementPresent command to verify the presence of at least one of the constituent elements on the page; argument being, if one element loads properly, it is safe to assume that all the elements and hence the modal window loaded up properly.
Hope this helps. If you want further help, you can share the code with me alongwith the error in execution that IDE throws out to you.
Modal window hacked:)
http://seleniumdeal.blogspot.com/2009/01/handling-modal-window-with-selenium.html
This is how I handle pop up alert in Selenium IDE
right click on the element (in this case your pop up window) there are some command you can choose. There's also a show all available commands whiche might be a help.
You should use AssertElementPreset and I guess the best locator in this case is CSS. So you can choose AssertElementPresent.
Or
you can use two command on Selenium IDE
selectWindow | null
verifyElementPresent | css=div.content
Hope this helps!