How can I control in which of my desktops the browser called by selenium remote server will pop up? - linux

I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background.
However, since every test calls a new browser via selenium remote server, and a new test management window and a application window are started, these new windows do not appear in the desktop which I started the php tests from, but in my current desktop taking the focus away from the window I am working in.
How can I control that the browsers are always opens in the desktop that is in the background (where I start phpunit)? I am using Kubuntu i.e. the KDE Desktop.
Thanks for any suggestions!

This is probably a bit late, but for anyone reading this: When you launch your selenium RC server, you could try exporting to a specific display using the command:
export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar
Using this, you could also export it to for instance an X virtual frame buffer (Xvfb), effectively running it in the background.

Related

How to set xdg-settings (or some other setting) to launch different web browsers based on launching application

I would like to have default launching of a browser to be different when launching from different programs.
For instance:
when I open a link from Discord I'd like it to be launched in
Firefox.
When I run npm run dev, I want my development app to
launch in Brave.
As for the second example, the issue I run into is that the browser window gets hi-jacked every time the code is updated. So I'd like the default launch from the npm application to launch a different browser than the one I'm using for research.

Running a GUI app on linux, without showing the gui?

I'm working with an api that requires an app to be started, the app runs a GUI on linux.
I need to punsh in some login information and then hide the app.
Is there a way I can go to the machine start the GUI and then hide it, log out, and have other users log in with out having the GUI shown, but still having the app running?
You can take a look at Xvfb http://en.wikipedia.org/wiki/Xvfb
it's a framebuffer version of X.
It will launch an X11 server without displaying it (useful with selenium for example)
Xdotool can send input to anyb xwindow, including xvfb

Linux - Make Application started in a terminal launch on a different display

I have inherited an application that is launched at login time from my server's .bashrc. The application starts two gnome-terminals. If I am logged in with a gnome desktop, it works great. Two terminals open on the desktop.
Sometimes I kill the application and must restart it. Works great if I launch it by hand from a terminal on the desktop (causing me to have 3 terminals open).
However, if I telnet into the machine where the application is installed, as .bashrc executes I get all sorts of "cannot open display" errors.
Well, of course I can't, I'm not logged in from a gui interface, But a desktop IS running on my server and is logged in using the same ID! Why not put the terminals there?
So how do I say, in bash, "start this application and send its output to 1) the display where you are now, or, 2) the one currently up on the server?" (I assume that found by looking at the env var display?)
Ubuntu 10.04 64 bits. I telnet to the server to start the vncserver so I can access the aforementioned desktop.
Thanks,
It depends on the application exactly, but generally you simply export the DISPLAY environment variable and the application should start on the specified display.
eg:
export DISPLAY=localhost:0.1
xterm &
Some applications would also (or alternatively) take a --display command line argument - check into the specific options available for the applications you're using.

Selenium not opening virtual browser window on Linux

I am using Selenium to conduct user interface tests with JUnit, in a Maven project. The project is located on a Linux box running IEs4Linux and Wine to allow us to run the tests in IE.
Right now I'm using Xming along with Putty to view the virtual browser windows, and I am able to open an IE window with the command "ie6", and I can see it functioning correctly in Xming.
When setting up the Selenium RC using the *iexplore browser mode, I get the following in the RC server window:
INFO - Command request: getNewBrowserSession[*iexplore, http://asdfasdfasdf.com:7011/, ] on session null
INFO - creating new remote session
INFO - Allocated session asdfasdfasdfasdfasdfasdfadsf for http://asdfasdfasdf.com:7011/, launching...
INFO - Launching Embedded Internet Explorer...
INFO - Launching Internet Explorer HTA...
Which is normal, except the browser never opens and the tests never run. Using *iexploreproxy or *piiexplore, I get the following error from the RC:
13:46:06.957 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.WindowsUtils$WindowsRegistryException: Problem while managing the registry, OS Version '2.6.18-164.11.1.el5', regVersion1 = null on session null
Is there any reason Selenium would fail to launch the IE window using *iexplore? I would use *firefox or *chrome but the application I am testing is only compatible with IE. Also note that these test cases run perfectly fine on my local Windows machine.
Please let me know if you need more details.
Got it working...in case anybody else attempts to use a similar configuration to mine...for whatever reason it seems you cannot start up the server with the Http.proxyName and Http.proxyPort settings when using IEs4Linux to open IE6...it will just ignore them. You have to manually open the IE6 browser and enter the proxy settings yourself (most likely localhost and 4444).
I think I'll start looking into IE7 for Linux...apparently IE6 doesn't like Selenium's use of XPaths.

Launching a web page in a different process

I want to launch the browser in a different process when a particular link is clicked on the page. When I checked the net I found the following tip: http://www.dslreports.com/faq/3849 . But there we have to change the registry. Is there any simple way of doing this without touching the registry?
If you use the Google Chrome browser, each new window or tab runs in a separate process. Internet Explorer version 8 will do the same (it's currently in the second beta round).
Earlier versions of IE will run a new window in a separate process if it is launched from, say, the Start menu or the command line, or a link in an email (but not by clicking a link within IE). I imagine you could create a proxy that the client would run through, which would intercept the links you care about and launch them by running a command line request. That seems like more trouble than mucking with the registry though (assuming that registry change still works -- looks like your link is from 2002).
I don't believe this is possible unless you change the client computer setup or software it's running.
Why do you want to do this?

Resources