I have a Spring Boot application with only api rest calls.
Everytime I press the "run on server" button a browser is launched trying to access the current file. Of course it always prompt an error:
Sorry for the image being in Spanish. It basically says that cannot download the resource.
My question is how to avoid this browser from launching everytime I run my application.
Thanks.
I found the solution to my problem. Here is what I did:
Go to Window > Preferences > General > Web Browser > New...
Add a new browser with:
name = NO BROWSER (or whatever you want)
location = C:\Windows\System32\cmd.exe
parameters = /c
Press OK.
Finally select Use external web browser, select the browser we just added and press Apply and Close.
The browser configuration should look like this.
Instead of using the cmd you could use a batch/shell script that does nothing (without the /c parameter which is only needed for the cmd to do nothing).
NOTE: This solution is applied to the IDE not to the project.
Related
I am facing an issue in making the custom protocol handler to launch IE behave correctly.
Here is what i am trying to do:
I have my webpage that that users are required to access in chrome. The page has links to some external web-applications. These external web-applications work well only on Internet Explorer.
I have to somehow launch IE with the url of the external web-app on click of the link.
The customer is not open to utilizing plugins like IETab for launching these external applications.
Hence, i have tried to define a custom protocol handler which would get the target URL as a parameter and launch the internet explorer browser with the target URL.
It seems to work fine as long as there is no IE window already open. But behaves differently when there is already an instance of IE running.
I used the following code:
In the HTML file:
function launchIE(target){
window.location = "launchIE:\"http://external.url.com?param1=1¶m2=2\"";
}
I have registered the handler to the custom protocol "launchIE" by adding the following into windows registry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\launchIE]
"URL Protocol"="\"\""
#="\"URL:launchIE Protocol\""
[HKEY_CLASSES_ROOT\launchIE\DefaultIcon]
#="\"iexplore.exe,1\""
[HKEY_CLASSES_ROOT\launchIE\shell]
[HKEY_CLASSES_ROOT\launchIE\shell\open]
[HKEY_CLASSES_ROOT\launchIE\shell\open\command]
#="cmd /C set myvar=%1 & call set myvar=%%myvar:launchIE:=%% & call start /separate iexplore %%myvar%% & exit"
With the above setup, when i click the button to trigger the above javascript I get Internet Explorer launched.
The IE opens the URL http://external.url.com?param1=1¶m2=2 correctly if there is no instance of Internet Explorer already open.
screenshot of IE showing correct URL
But, if there is already an instance of IE opened (either manually by the user or due to a prior click on the button on my page), IE opens an incorrect URL http://%22http//external.url.com?param1=1¶m2=2"
screenshot of IE showing wrong URL
Please help ... how should i fix this ?
I am working on windows 10 & IE 11.
I resolved it by creating a separate batch file, and surrounding the URL with double quotes:
[HKEY_CURRENT_USER\Software\Classes\ie\shell\open\command]
#="cmd /C c:/tmp/ie.bat \"%1\" & exit"
ie.bat:
set var=%1
set var=%var:ie:=%
call start /separate iexplore %var%
exit
I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute on a http to open the web page?
Windows Command Prompt
You can use the start command to do much the same thing as ShellExecute. For example
start "" http://www.stackoverflow.com
This will launch whatever browser is the default browser, so won't necessarily launch Internet Explorer.
1.To run from the default browser, use
start http://www.stackoverflow.com
Please make sure that the appropriate browser is set as default at Control Panel-> default program :
2.To launch page from specific browser, one can use
start "iexplore.exe" http://www.stackoverflow.com
start "chrome.exe" http://www.stackoverflow.com
start "firefox.exe" http://www.stackoverflow.com
Unfortunately, the best method to approach this is to use Internet Explorer as it's a browser that is guaranteed to be on Windows based machines. This will also bring compatibility of other users which might have alternative browsers such as Firefox, Chrome, Opera..etc,
start "iexplore.exe" http://www.website.com
When you use the start command to a website it will use the default browser by default but if you want to use a specific browser then use start iexplorer.exe www.website.com
Also you cannot have http:// in the url.
hh.exe (help pages renderer) is capable of opening some simple webpages:
hh http://www.nissan.com
This will work even if browsing is blocked through:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer
start did not work for me.
I used:
firefox http://www.stackoverflow.com
or
chrome http://www.stackoverflow.com
Obviously not great for distributing it, but if you're using it for a specific machine, it should work fine.
I need to download a file from application in my selenium RC test.
When i click on the link/button to save a file, first i get a pop up which asks me to either open or save the file, when i select 'Save' and click 'OK' then i get one more pop up asking me to provide the path where file is to be saved and file name also.
I goggled and found that this could be done via AutoIT but i am facing some problems while doing that.
so could some one please provide me the .exe file for file_download in Firefox and also where i can mention the path to save that file too.
and also if you could provide me what exactly the code, i need to write in my test case.
Please let me know how to handle this.
You can achieve that without using autoit also. follow below steps.
Create new firefox profile.
Change the preferences in that profile manually before starting the automation with that profile. (Change the settings like below)
Now start the automation using that profile so that files will be downloaded to default location.
Starting selenium server using specfic profile
java -jar selenium-server.jar -firefoxProfileTemplate "C:\Users\UserName\AppData\Roaming\Mozilla\Firefox\Profiles\234saddsf.customProfile"
I found this link: http://qtp-help.blogspot.com/2009/07/selenium-handle-dialogs.html
Unfortunately it is for the old style dialog boxes that do not have the open vs save radio buttons. I'm searching for a solution to this part of the problem.
We have a VB6 application here that automates the process of opening drawings and printing them with a specific printer that turns them into TIFF files.
I'm in the process of testing the application as we upgrade from V8 to V8i and I'm running into some problems just launching the application.
If I open the Microstation normally via the exe file everything works ok. But when I do:
Set msApp = CreateObject("MicrostationDGN.Application")
It opens a blank microstation window with no menus or anything (basically what the window looks like behind the file open dialog)
And then I do
msApp.OpenDesignFile ("dummy.dgn")
that looks like this: imgur.com/A5rc4.png
Is there something new with v8i where it doesn't bother loading the gui when opened as an object?
Did your application depends on some user preference of Microstation? I think you can debug your aplication step by step.
You can call the ustation.exe with the parameter -debug. This creates a file called debug.txt in the current working directory.
There you might find some helpful info.
I have Firefox as my default browser on my dev machine and when I start debugging from visual studio Firefox launches as I would expect and all the attributes of the experience are the same as IE except for one thing - when I close the browser. When using IE, when I close the browser visual studio will automatically shut down the debugger. When I close FF I do not get this behavior - does anyone know how to make this happen?
The reason for this behavior is very simple: Visual Studio attaches itself to the process to be debugged, and will drop out of run mode if it sees that process terminate. FireFox does not create a new process every time a window is launched: it reuses the existing process. IE is able to create a new one for each window (depends on option settings). If you already have FF running and you launch an app to be debugged, the app window is created in the existing process and VS attaches to that process. When you close the app window the process doesn't terminate because it is still active for the pre-existing windows. Next time it happens close all the other FF windows and you will see Visual Studio drop out of debug run mode. If there was a way to tell FireFox to create a new process for a new window then this problem would go away. I haven't found any reasonably reliable way to do that.
To add to Mark's answer, you can setup a specific "debug" profile for firefox, and then change the project's properties/Web, select there "start external program" and browse to firefox.exe, and set commandline arguments to '-no-remote -P "MyDebugProfile" '.
To manage your profiles, start (from command-line) firefox like this:
c:\> <installation path of ff>\firefox.exe -profilemanager
There, you create a new profile (lets say "debug")
To start a new process of FF with this profile (i.e. what you set for VS):
c:\> <install path to ff>\firefox.exe -no-remote -P "debug" "http://mysite"
Note, that the "-P" parameter is case sensitive.
Right click on any .aspx page and choose the option "Browse With..." there you can setup the default browser
Try attaching the debugger to the FireFox process instead!
In VS (2008) select the Menu option Debug -> Attach to Process and then select firefox.exe - if you don't see this process you may have to ensure 'Show processes in all sessions' is checked.
I ran this and verified that it does work. I also verified that closing FireFox via app debug does not work, if you Firefox is set as the default browser in VS 2008.