Avoid opening command history window while running selenium rc - selenium-rc

I am new to Selenium. Whenever I run the selenium script to open the browser, it additionally opens a selenium console window with the command history.Is there any way of suppressing the browser from opening this window?

I don't know if it possible to avoid presentation of the command history, but if you want to avoid opening additional window with logs, run Selenium RC with -singleWindow parameter.
java -jar path/to/server/selenium-server-standalone.jar -singleWindow

Related

How to open chrome new session using UFT

Sometimes chrome is already open. During run time, UFT opens the AUT in chrome. The script fails sometimes because chrome was already open before the test run. I usually keep the chrome closed before the test runs for a consistent test run. However, it is difficult to keep chrome closed always because I need to keep other applications like Gmail open while I am running tests.
This is the code I have to open chrome.
SystemUtil.Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","www.google.com"
How can UFT open the new session of chrome so UFT ignores the previous session of chrome during run time?
#bugfinder
Option1: Killing the chrome process when you run the test
SystemUtil.CloseProcessByName("chrome.exe")
Option2: Use "CreationTime:=1" ordinal identifier to perform actions on newly created browser instance
If the UFT will run only on the second browser
If you want to open 2 browsers and wanted to perform actions on a third browser then use "CreationTime:=2"
SystemUtil.Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","www.google.com"
Browser("CreationTime:=1").Page("title:=Google").WebEdit("name:=q").Set "what to search"
Use the SytemUtil.CloseProcessbyWndTitle
You can provide regular expressions if parts of the title of your application are changing.
In case that is not possible, I'm afraid you will have to write your own cleanup method where you close all Chrome Instances except the ones you want to spare.

autoit open firefox and activate addon

I am new AutoIT. I see it has a lot of potential.
How can I write autoit code to open FireFox from specific location and inside it activate addon. Then the autoit code would navigate to a link?
I have some examples but it has been less then 1 hour since I started working on autoit.
My goal is to change FireFox profiles, run links inside each of those and close Firefox.exe after some time...
You can run the FireFox.exe to just bring the browser up (here is the documentation on that) and there is a FireFox AutoIt library available
You can use any of the below command to run your browser or any file
ShellExecute("filename")
or
Run( "The full path of the program f.ex- any exe or bat file")

Xamarin Studio fails to execute code with login shell in Mac Terminal

I'm new to Xamarin on the Mac, and I'm running into some issues running my code. I don't think it should matter, but I'm using the D language plugin to develop my code.
When Terminal is set to Shells open with: Default login shell (which is zsh in my case, but bash results in the same issue), hitting the execute button causes Xamarin Studio to pop up a Terminal window which closes before it can do anything, and then Xamarin Studio reports Cannot execute "blah". ScriptError. I added an infinite loop at the beginning of my program to make sure the shell isn't exiting because the program terminated quickly, and sure enough the program seems not to be starting at all.
If I instead tell Terminal Shells open with: Command (complete path): /opt/local/bin/zsh, the terminal happily opens up and the window is named correctly as "Xamarin Studio External Console" but of course nothing is executed except for the shell itself.
Any way to debug or fix this would be greatly appreciated!
MonoDevelop/XamarinStudio uses xterm by default. Dunno if that piece of info might help.

From a shell script open a new tab in a specific instance of Firefox

I have a shell script that creates Firefox profiles and then uses them to open multiple instances of Firefox simultaneously. The problem is how can I open a URL in a particular instance of Firefox?
I have tried
firefox -CREATEPROFILE test
firefox -P test -no-remote
firefox -P test -url www.google.ie
But the last part which is trying to open the URL using the test profile does not work, it always opens in the default profile.
Is there any way to tell Firefox from the command line to open a URL using a particular profile?
Thanks.
EDIT: I am using Linux, I don't think its possible to do what I want to do from the command line (However, Firefox command-line options are not fully documented so it could be possible). One solution to my problem would be to use JavaScript to open the tabs once the browser has been executed. I think changing the default profile to the profile I want to open each time I want to load a new URL may work also. This will require changes to profiles.ini each time a new URL is loaded. I haven't tested this but it looks promising.
Yes this can be done, Modify your profiles.ini (/home/username/.mozilla/firefox/profiles.ini) to change the default profile each time you want to open a URL in a different profile.
I know this is a bit of a pain but it works and its the only way to do this. Now I can have multiple Firefox instances/profiles open simultaneously and still open new tabs in which ever instance I want from my shell script.
YAY!
Unfortunately Firefox only supports one remote profile at a time, so all your command lines have to remote into the same process. (Mozilla Suite for Linux supported a per-profile remote, but then again it didn't support the -profile flag.)
On the other hand if you know all the URL(s) that you want to load in advance, then you can simply pass all of them on the Firefox command line, concatenated with | characters (but quoted to stop the shell interpreting them). So for instance if you want to start a new instance of the test profile opening the page www.google.ie (only), use firefox -no-remote -P test -browser www.google.ie

VS2008 debugging with firefox as default browser - how to make the debugger stop/close on exit?

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.

Resources