Protractor - Changing the target window - protractor

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?

Related

How to work on multiple browsers within a single testcase in TestRigor?

I need to invoke a new (other) browser within a testcase.
Say., If we are working by default on Chrome, I need to invoke a Firefox/Edge browser within the testcase. Additionally the user session in one browser is expected to be retained when we switch across the two browsers. How is this achievable with TestRigor?
Click on your Test Suite.
Click 'Settings' at the bottom of the left hand column
Click the 'Multiple browsers' tab at the top of the page.
Choose the OS (Windows, Ubuntu (Linux) or OSX (Mac)
Choose the Browser for the chosen system.
Click the 'Add Browser' button.
Click the 'Save' button
Return to a test.
Under 'Quick Actions' click 'Re-test'
Click the Execution UUID link and you can see all OS/Browser combinations executing.

Import/export Chrome devtools breakpoints & settings between computers

Quoting the original idea:
I came across a problem where I need to share all my debugger breakpoints to my colleague to debug the issue at his end. So thought of implementing something like export the debugger points from one system and import at other system.
Since devtools doesn't provide a built-in import/export feature, is there another way?
Use devtools-on-devtools:
open devtools and switch its Dock side in the menu to a detached (floating) window
in the now detached devtools press CtrlShifti or ⌘⌥i on MacOS,
which will open devtools-on-devtools in a new window
UI method:
in this new window switch to Application tab, expand Local Storage, then devtools://devtools on the left
double-click breakpoints value on the right and copypaste it
Now do the same on the target computer and reopen the main devtools window afterwards.
Console method (especially useful if the value is too long):
run copy(localStorage.breakpoints) in devtools-on-devtools console on the source computer to copy the value to clipboard
run localStorage.breakpoints=prompt() on the target computer
(the prompt will appear in the main devtools window).
Console method to export everything:
run copy(JSON.stringify(localStorage)) in devtools-on-devtools console on the source computer to copy the value to clipboard
run Object.assign(localStorage, JSON.parse(prompt())) on the target computer
(the prompt will appear in the main devtools window).
P.S. Next time you can quickly toggle the detached state of devtools by pressing CtrlShiftD

Is there a way to open Chrome Dev tools to a new window right away?

Anyone know of a way to open Chrome Dev tools to a new window upon open?
I know that I can click F12 and then click the 'customize' button and change orientation or pop out the dev tools window. But that's an extra step, and often a window resize is necessary, and when you do it 50 times a day, it gets to be tedious.
Also, sometimes, on pages I'm testing, pressing F12 will change the layout of the elements on the page and even popping out the dev tools leaves the page layout different than before I opened dev tools. This can make it hard to tell if an element is visible or not, which makes troubleshooting Webdriver more difficult.
Ideally, CTRL+F12 or something to open dev tools as a separate window would be super handy. (to any Chromium devs that might be listening ;) But if anyone has another solution, I'd love to hear it.
If you have your DevTools un-docked, the dock mode, size and position of your DevTools window will remain the same as you previously set it. For example, I just set mine to be maximised on my other monitor. Every time I open up DevTools, it's an un-docked, maximised window, and there's no change to the layout of the inspected window other than the fact it's no longer in focus.
You could alternatively launch Chrome using the --auto-open-devtools-for-tabs flag, which will automatically open DevTools in the dock mode, size and position you had it previously. You can use:
Mac:/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --auto-open-devtools-for-tabs
Windows: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --auto-open-devtools-for-tabs
In WebDriver, you can set flags for how Chrome opens. However, after looking into this further, it turns out Chrome currently do not support multiple clients connected to the protocol simultaneously.
As for speeding things up, you can switch between dock positions with Cmd+Shift+D (Mac) or Ctrl+Shift+D (Windows). This toggles between the last two modes you have used, so say you have it docked at the bottom, you then pop it out, using the shortcut now will toggle between the two.
Here's how you do it. On opening the developer tools, with the developer tools window in focus, press F1. This will open a settings page. Check the "Auto-open DevTools for popups".
Originally documented here -- https://newbedev.com/automatically-open-chrome-developer-tools-when-new-tab-new-window-is-opened.

Open Chrome Developer Tools tabs in a new window to show on multiple monitors

Is there a way where one can open a specific tab of the Chrome Developer Tools in a separate window? I have got 3 monitors and would like to have the Sources tab on one screen and the Elements on another screen. Is this possible?
I find this limitation frustrating too, all those other monitors are wasted! Here is poor man's solution:
launch your chrome with --remote-debugging-port=9999 command line parameter
right click on your page to debug and select 'Inspect Element' - this is your debug window #1
open a separate chrome window and navigate to chrome://inspect
click 'Configure...' and add localhost:9999
within a couple of seconds under 'Remote Targets' you should see tabs you can inspect from your other chrome instance
click on the tab, and now this is your debug window #2
Unrelated tip: system wide nightmode experience: http://danielsokolowski.blogspot.com/2018/11/windows-10-8-7-night-mode.html

In Eclipse, can I have multiple Console views at once, each showing a different Console?

I'm working on some applications that, in debug mode, log to the console. I'd like to run and debug them from inside of Eclipse, and view the console for each one simultaneously. However, I have a single Console tab that shows a single Console output at a time. Is there a way I can split the consoles into multiple views so that I can have side-by-side console output?
Yes,
located near your console tab should be a button "Open Console".
If you click this button one of your options should be "New Console View".
You'll now have 2 console views.
One of your other buttons near your console tab is "Display Selected Console". When you choose this option you can select from any of your running applications.
Just select the tab, select which application you want it to watch, and repeat for the other tab.
You can then move your 2 console views to wherever you want independently of each other.
I'm using Eclipse Helios Release with build ID: 20100617-1415.
The best thing you can do is the following.
Window > New Window.
That will create another eclipse window like you currently have. Run the desired application, switch the console on the new window to display the desired console output with open console button on the console view.
A bit clunky but the only way to get multiple consoles at the same time. If your new windows doesn't have console open use
Window > Show View > Console
Goodluck
The post of Chase Henslee it's correct after click on 1, you must deactivate the second behavior with second step and at finish you can change the console with 3 step.