How to show run tool only when there is an error in IntelliJ Idea? - intellij-idea

I use TDD quite a lot, and I was wondering if there is a way to show the Run Tool window only when there are failed tests?
Or to be more generic, for any run configuration, I would like the Run Tool window to be shown only when something goes wrong. Otherwise I would prefer the little non-obtrusive green pop-up to appear. Like when you run a lot of tests and you minimize the Run Tool by clicking on the "down arrow" in its top-right corner. When the tests are done, a little green pop-up appears over the minimized window.
I would also compromise for an answer that tells me how to keep the Run Tool always minimized, and only see little pop-ups, regardless if they are green or red.

This is probably not exactly the answer you wanted but if you look in the RunConfiguration (Run->Edit Configurations -> JUnit) for your test run you should see a checkbox called 'Activate tool window'. If that box is ticked then the Run Tool window will pop open even if its minimised. When it's not ticked then the Run Tool window will stay minimised.
So, for any individual existing test run you can change the check box value to prevent the tool window appearing. If you're doing TDD that could mean you have many configurations for specific test cases / suites etc, which you would need to change individually.
In the longer term, you probably want to avoid future run configurations popping up the test. You can do that through the Defaults -> JUnit section in the RunConfigurations window.

Also, in the tab "Logs" you can check the option "Show console when a message is printed to standard error stream"
When this option is checked the window is opened automatically if some test fails.

Related

IntelliJ IDEA - How to reattach and place Console tab back to IDE

Am new to IntelliJ IDEA (am using 2017.1.3)...
Accidentally, made my Console tab window float and can't seem to reattach it to IntelliJ IDEA. When I run the Debugger, it launches as a separate window (which is very annoying).
Is there a way to reattach it back to the main window but on right of the Projects view and right underneath the Source Editor view?
Attached is a screenshot of the issue, at hand (which one can click on to see it in high res):
Update
Okay, somehow (by doing a lot of clicking and dragging), this is the closest that I've come to what I've want. The thing that's bothersome is that I can only see the Console (stdout) updated when the debugging session is over (not in real-time, as I've would been able to do in Eclipse). :(
Update the console in realtime:
If you want all the JUnit test output to the console in real-time, just do as follows:
choose the configure
do configure for JUnit
floating separate tab of windows need restore on the tab.
You have two methods to restore floating windows:
uncheck the floating mode in the terminal windows
uncheck the floating mode in the Windows/Active Tool Windows
Let me show the 4 location of Console in the Debug view, I think there should be one which is what you want:
first
second
third
last

Restrict core usages PyCharm

I have this program that I've written in PyCharm. This program should be running for a week or so, and it is very processor-needy. So when I run it I pretty much have no use of my notebook, as it becomes very laggy.
Is there a way to somehow tell PyCharm to use first three of my cores and leave one for other programms so they can operate normally?
Go into task manager
Find the running task (it probably won't be the main pycharm window)
Right click and select "go to details"
Right click on the details and click "set affinity"
Select whatever cores you wish the program to use
Alternatively you can use the "set priority" sub-menu and set it to "below normal". All other processes are normal priority by default, so it shouldn't interfere with anything, but still use any other available processing power. You can do the same thing with long installations or automatic windows updates so they don't slow you down.
I should also note that both of these selections will be reset upon restarting the program. Additionally, if you are using windows 7, you don't need to "go to details". Everything will appear in the context menu for the process.
Unfortunately, I don't know how to do this in pycharm.

IntelliJ Debug tool window switches from Console to Debugger

This will probably sound like a minor issue, but it's completely messing up my workflow:
I have a microservice that I restart frequently to refresh changes. I start in Debug mode, and use the curvy arrow in the upper left of the Debug tool window to stop/start the process.
In the Debug window, there are 2 tabs, Debugger and Console. For weeks, I've kept this on Console, and I can see the service run through startup, and I know when to start hitting endpoints. All of a sudden, whenever I start up, it switches to the Debugger tab, which means I have to manually switch back.
No documentation on this, and didn't find anything with a Google search. Does anyone have something to try?
Thank you
Update:
I start with the focus on Console (the right tab) and it switches to Debugger (the left tab). There is a "Focus on startup" in the context menu for Console, but it has no effect.
I'm not sure this is exactly what you're looking for. If it's not, could you please add some screenshots to the question which might better illustrate the problem? But if it is, here is what I found:
In the Debug tool window you have tabs like Output and Variables, which are probably the tabs you are talking about. You can right click any of these tabs and select Focus On Startup. You probably have this option selected for the wrong tab. So try selecting it for the Output tab.
You can toggle the Focus On Startup behavior for other tabs in the Debug tool window too.

Element link not found in Selenium

I am executing a simple recorded script in Selenium , in which i just search a page in Google and then click it , but when Run that recorded script it is giving me the "Error [error] Element link not found".
And following is the Script which i am running,any help would be very useful.
New Test
New Test
open
/
type
q
Bill Gates
click
link=Bill Gates: Chairman
click
link=Bill Gates: Chairman
I got the same error message while going through the tutorials online. I found out that the scripts were running too fast for FF to load the links. If you slow down the playback by moving the green button on the Fast-Slow bar to somewhere in the middle the scripts run without any errors.
I guess I know the answer. It might be bcz of any javascript error(you can see that on the status bar at the
Right corner(IE)) or that link element might not be placed correctly in the box(box model).
Here you can use
Selenium.focus("link=text")
:selenium.keyPressNative("10") . It presses the enter key.but while selenium is executing this statement
Do not change the focus from your AUT (don't touch the mouse).
In IDE ,just paste the above statement on click().
Well, I don't think you have to slow the speed down. You know the problem is caused by clicking on the link before it is available, so you could add an extra command waitForVisible (e.g. link=Bill Gates: Chairman) before the clickAndWait command.
Im assuming you are using Google instant as there is no "click search button" command, the link is probably not preset because selenium is not waiting for Google instant to respond or the javascript to render the link. If you manually add in a click command to search it should solve it.
My solution is almost the same as Cuongs. Though I change the speed by using a command and change it back afterwards.
Before you click the link, you can set the speed to slow:
Command: setSpeed
Target: 3000
You can change the speed afterwards again to ~1000
I also had same problem. I did two things which fixed the problem. I changed the speed in Selenium IDE from fast to slow (located at top left of IDE), and I minimized the IDE after hitting play button. I guess for people using only one monitor, minimizing Selenium IDE would help the test find the thing it is looking for; for ppl with two screens, opening Selenium IDE in one screen, and opening browser in another screen would be best.
Info: Installing this plug-in (Selenium IDE: Flow Control) fixed lots of unexpected errors for me while playing with Selenium IDE:-
https://addons.mozilla.org/en-US/firefox/addon/flow-control/?src=dp-dl-othersby

Automation of DOH Robot tests interrumped by Pop-up message

In order to automate DOH tests during our build process, I use Selenium RC to launch different browsers (IE and Firefox) on a server placed on a different domain than the build machine. Each browser is directed to our runTests.html in order to start DOH.
Sometimes, when a test that uses doh.robot starts, the following message is shown:
"DOH has detected that the current web page is attempting to access DOH, but belongs to a different domain than the one you agreed to let DOH automate. If you did not intend to start a new DOH test by visiting this Web page, press Cancel now and leave the Web page"
but since these tests are unattended it just sits there waiting for someone to click OK, and Selenium times out (in IE 8 it seems like the pop-up disappears automatically but the robot does nothing afterward).
As I said, it doesn't always happen. After you click OK on the Pop-up, the message will stop showing, and the message can go away for several sessions, but then it will show again in which seems to be an arbitrary way.
Does anyone knows a way to prevent this pop-up from showing?
This is probably not the correct way to do it, but in util/doh/robot/DOHRobot.java, you may be able to modify the code to not check that or always simulate pressing "OK". I haven't tried it myself, but I may also need to do that for some of our automated testing.
When the DOH robot is initialized, it first tries to click in the upper left corner of the page you are trying to test. If you obscure this div (you can see it with firebug), then the message will pop up. I think the problem is that your page isn't always loading up quick enough.
It is somewhat of a challenge to fix this. I haven't used DOH in awhile, but I don't think there is any way you can use a setTimeout to fix this. (You can try using setTimeout on the doh.run command, but it might be the case that the DOH robot clicks that div before parsing any doh commands.)
Another thing you might be able to do is add a sort of "wait" command to Selenium, or whatever shell command you are using to fire up the system.