gnome-terminal --tab --title="<yourTitleHere>"
--working-directory=<yourPathToSeleniumHere> --display=:0.0 -x sh -c
"<yourSeleniumCommandHere>" &
This is of course assuming you are running gnome.
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/selenium-users?hl=en.
>
>
--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
If you have received this email in error please notify postm...@ardescosolutions.com
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
It's difficult to run complex jobs like this from cron where you
require an Xsession, like this selenium session which wants to run
Firefox, an X app. That's what the error is telling you, that
selenium can't run an X application. X requires, well X, and a lot of
environment, none of which are around with cron.
You could get an active X session going, then use 'at' instead of
cron. At preserves all the environment present when the at-job was
created. The issue with at is that it doesn't have the recurrent
scheduling of cron, but there is a workaround. If the job needs to
repeat, you could make a shell script that does what you need, then re-
creates an at job at the end of the shell script, then install this
script as the at job. It will repeat because it re-installs itself.
Then just keep this X session going.
I have also set things up so that DISPLAY 0, the console, is available
to run the firefox session from cron -- or an active x session of a
user on whatever DISPLAY. This required carefully setting up the
environment as well as xhost to allow the cron user to be able to
launch apps on the DISPLAY.
For me, a better way is to run a vnc session. Vnc creates an X
session inside it. Inside the vnc session, get everything set up
nicely to run your test from a terminal. You could capture the
environment of this session from this terminal by dumping it with
printenv. You can then put this environment in a file and make it
part of what you call from cron, like a shell script that you set up
to call from cron. Depending on the way you go, you might have to do
something with xhost to give the cron user permission to create
programs in the vnc display.
If I was setting something up, I would use the vnc with at and not use
cron at all. It isn't X-app friendly.
On Mar 22, 4:21 am, visa <vidyasagar...@gmail.com> wrote:
> When i am running seleniumtests normally ,they are running,...but when
> i am sheduled the tests to run each an hour using crontab,the
> following error is coming:
> 15:30:03.694 INFO - Checking Resource aliases
> 15:30:03.698 INFO - Command request: getNewBrowserSession[*chrome,http://www.flipkart.com, ] on session null
> 15:30:03.700 INFO - creating new remote session
> 15:30:03.773 INFO - Allocated session 4105b2ad9d3448a4a3e1dba1cd660690
> forhttp://www.flipkart.com, launching...
You will now need to make sure all users on the local host can connect
to your X session. Do this with the following:
$>xhost +localhost:
Add your selenium_from_cron.sh file as your cron job as you did
before.
Now, disable all the screen savers and autologout that you have so
that this X session remains active. As long as this X session is
active, this approach will work. If the machine reboots, you will
have to restart this X session. This is the weakness of this
approach.
There are several workarounds to this weakness if you are interested.
One is to have an X session brought up on the console on startup
instead of bringing up gdm or other X-based logon manager. Then, use
this X session as the target of your selenium cron job. The other is
to bring up a X-based vnc session on startup and make this session the
target of your selenium tests. These would require more setup.
On Mar 23, 2:27 am, visa <vidyasagar...@gmail.com> wrote: