I’ve installed selenium-server-standalone-2.42.2.jar in a debian virtual box
and installed Firefox 29.0
and trying to run the following script with phpunit which is the only file in the directory:
<?php
class TestLogin extends PHPUnit_Extensions_Selenium2TestCase{
public function setUp()
{
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowser('firefox');
$this->setBrowserUrl('http://debian-vm/phpUnitTutorial');
}
public function testHasLoginForm()
{
$this->url('index.php');
$username = $this->byName('username');
$password = $this->byName('password');
$this->assertEquals('', $username->value());
$this->assertEquals('', $password->value());
}
}
I get the following error:
1) TestLogin::testHasLoginForm
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Unable to connect to host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
What does this mean?
I’ve red several threads and apparently I had to do the following which I tried:
1)to type this in the command shell
export PATH=:0;
Result: I got the same error.
2) I’ve installed vnc4server and getting debian-vm:1 as a application I then set export PATH=debian-vm:1
run it with realvnc and in the viewer (which works) I got the same problem.
asked Jul 9, 2014 at 12:00
4
You receive this error, because you have not set the DISPLAY
variable. Here is a guide how to perform the test on a headless machine.
You have to install Xvfb and a browser first:
apt-get install xvfb
apt-get install firefox-mozilla-build
then start Xvfb:
Xvfb &
set DISPLAY
and start Selenium:
export DISPLAY=localhost:0.0
java -jar selenium-server-standalone-2.44.0.jar
and then you will be able to run your tests.
answered Jan 9, 2015 at 15:33
4
These days setting up headless is as easy as passing an option to the selenium browser driver.
On most environments this can be done by setting the env variable MOZ_HEADLESS
before running your tests, i.e try:
export MOZ_HEADLESS=1
Then, rerun your tests and it should run headless.
If you’re out of luck, and it doesn’t pick up the env var, try enabling the headless support in the driver config. E.g: with phpunit-selenium lib, do this:
Firefox
$this->setDesiredCapabilities(['moz:firefoxOptions'=> ['args' => ['-headless']]]);
Chrome
$this->setDesiredCapabilities(['chromeOptions'=>['args'=>['headless']]]);
See php-webdriver wiki for more selenium options.
answered Aug 7, 2020 at 16:29
tutuDajujututuDajuju
10k5 gold badges65 silver badges88 bronze badges
1
Certainly scripting is the way to go, however iterating through all possible DISPLAY values is not as good as using the right DISPLAY value. Also there is no need for xvfb at least in debian/ubuntu. Selenium can be run locally or remotely using a current DISPLAY session variable as long as it is correct. See my post in http://thinkinginsoftware.blogspot.com/2015/02/setting-display-variable-to-avoid-no.html but in short:
# Check current DISPLAY value
$ echo $DISPLAY
:0
# If xclock fails as below the variable is incorrect
$ xclock
No protocol specified
No protocol specified
Error: Can't open display: :0
# Find the correct value for the current user session
$ xauth list|grep `uname -n`
uselenium/unix:10 MIT-MAGIC-COOKIE-1 48531d0fefcd0a9bde13c4b2f5790a72
# Export with correct value
$ export DISPLAY=:10
# Now xclock runs
$ xclock
answered Feb 6, 2015 at 19:03
4
The following is not the right variable:
$ export PATH=:0;
That defines where to find executables, such as in /bin, /usr/local/bin.
You’re working with X11 variants and in that context, :0 refers to DISPLAY localhost:0.
So you probably intended the following:
$ export DISPLAY=:0
But as others have pointed out there needs to actually be an Xserver (virtual or otherwise) at that DISPLAY address. You can’t just make up a value and hope it will work.
To find a list of DISPLAYs that your user is authorized to connect to you can use the following, then set your DISPLAY variable according (host:displayNumber, or :displayNumber if on the local host):
$ xauth list
answered Feb 19, 2020 at 21:58
I’ve installed selenium-server-standalone-2.42.2.jar in a debian virtual box
and installed Firefox 29.0
and trying to run the following script with phpunit which is the only file in the directory:
<?php
class TestLogin extends PHPUnit_Extensions_Selenium2TestCase{
public function setUp()
{
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowser('firefox');
$this->setBrowserUrl('http://debian-vm/phpUnitTutorial');
}
public function testHasLoginForm()
{
$this->url('index.php');
$username = $this->byName('username');
$password = $this->byName('password');
$this->assertEquals('', $username->value());
$this->assertEquals('', $password->value());
}
}
I get the following error:
1) TestLogin::testHasLoginForm
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Unable to connect to host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
What does this mean?
I’ve red several threads and apparently I had to do the following which I tried:
1)to type this in the command shell
export PATH=:0;
Result: I got the same error.
2) I’ve installed vnc4server and getting debian-vm:1 as a application I then set export PATH=debian-vm:1
run it with realvnc and in the viewer (which works) I got the same problem.
asked Jul 9, 2014 at 12:00
4
You receive this error, because you have not set the DISPLAY
variable. Here is a guide how to perform the test on a headless machine.
You have to install Xvfb and a browser first:
apt-get install xvfb
apt-get install firefox-mozilla-build
then start Xvfb:
Xvfb &
set DISPLAY
and start Selenium:
export DISPLAY=localhost:0.0
java -jar selenium-server-standalone-2.44.0.jar
and then you will be able to run your tests.
answered Jan 9, 2015 at 15:33
4
These days setting up headless is as easy as passing an option to the selenium browser driver.
On most environments this can be done by setting the env variable MOZ_HEADLESS
before running your tests, i.e try:
export MOZ_HEADLESS=1
Then, rerun your tests and it should run headless.
If you’re out of luck, and it doesn’t pick up the env var, try enabling the headless support in the driver config. E.g: with phpunit-selenium lib, do this:
Firefox
$this->setDesiredCapabilities(['moz:firefoxOptions'=> ['args' => ['-headless']]]);
Chrome
$this->setDesiredCapabilities(['chromeOptions'=>['args'=>['headless']]]);
See php-webdriver wiki for more selenium options.
answered Aug 7, 2020 at 16:29
tutuDajujututuDajuju
10k5 gold badges65 silver badges88 bronze badges
1
Certainly scripting is the way to go, however iterating through all possible DISPLAY values is not as good as using the right DISPLAY value. Also there is no need for xvfb at least in debian/ubuntu. Selenium can be run locally or remotely using a current DISPLAY session variable as long as it is correct. See my post in http://thinkinginsoftware.blogspot.com/2015/02/setting-display-variable-to-avoid-no.html but in short:
# Check current DISPLAY value
$ echo $DISPLAY
:0
# If xclock fails as below the variable is incorrect
$ xclock
No protocol specified
No protocol specified
Error: Can't open display: :0
# Find the correct value for the current user session
$ xauth list|grep `uname -n`
uselenium/unix:10 MIT-MAGIC-COOKIE-1 48531d0fefcd0a9bde13c4b2f5790a72
# Export with correct value
$ export DISPLAY=:10
# Now xclock runs
$ xclock
answered Feb 6, 2015 at 19:03
4
The following is not the right variable:
$ export PATH=:0;
That defines where to find executables, such as in /bin, /usr/local/bin.
You’re working with X11 variants and in that context, :0 refers to DISPLAY localhost:0.
So you probably intended the following:
$ export DISPLAY=:0
But as others have pointed out there needs to actually be an Xserver (virtual or otherwise) at that DISPLAY address. You can’t just make up a value and hope it will work.
To find a list of DISPLAYs that your user is authorized to connect to you can use the following, then set your DISPLAY variable according (host:displayNumber, or :displayNumber if on the local host):
$ xauth list
answered Feb 19, 2020 at 21:58
When running the command pytest app/gui_tests/selenium/ --browser=firefox --headless -v -s
in Docker I got the error from selenium: Exception: Message: invalid argument: can’t kill an exited process
I tested to run firefox manually with firefox -headless
and it seemed to work fine as it output *** You are running in headless mode.
So I checked the geckodriver.log
for clues
I found this log entry
1600603147457 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofileLUeNt1"
Error: no DISPLAY environment variable specified
What struck me was that it wasn’t using -headless
as an argument to Firefox, which would explain why it would complain about the DISPLAY env not being set.
Is this a bug since I used the parameter --headless
for selenium (and it seem to be default set as well). Or am I misunderstanding something?
Also as a side note. It would have been nice if the error from seleniumbase would have been nicer and included the Error: no DISPLAY environment variable specified
message directly, instead of having to check the geckodriver.log
The annoying part is that it works perfectly fine in a Github Action container, but not when I create my own Dockerfile. Not sure what magic Github is doing when they create their own.
FYI When I run it in Github Actions the geckodriver.log
file has this content instead
1600627799085 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile7Vv40c"
console.error: SearchCache: "_readCacheFile: Error reading cache file:" (new Error("", "(unknown module)"))
1600627814960 Marionette INFO Listening on port 35239
1600627815019 Marionette WARN TLS certificate errors will be ignored for this session
JavaScript error: resource://gre/modules/URIFixup.jsm, line 271: NS_ERROR_FAILURE: Should pass a non-null uri
1600627819117 Marionette INFO Stopped listening on port 35239
In docker:
seleniumbase==1.42.5 (tried upgrading to 1.49.16 but same issue)
pytest==5.4.3
python 3.8.2
firefox 80.0.1
Ubuntu 20.04
geckodriver = 2.44
Решено: Как задать экран на удаленном компьютере?
Модератор: Bizdelnick
-
Shura
- Сообщения: 1537
- Статус: Оказывается и без KDE есть жизнь
- ОС: FreeBSD 8.0-RC2
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 23.02.2011 12:35
Shura писал(а): ↑
23.02.2011 11:37
На каком компьютере это задавать? Я вхожу с одного компьютера внешней сети на другой а уже через него на компьютер локальной сети которая подключена на его вторую сетевую карту
Я запустил ваш код на последнем компьютере а хочу видеть браузер на своем в сессии SSH
alabama@ubuntu:~$ export DISPLAY=<remote ip>:0; firefox
-bash: remote: Нет такого файла или каталога
Error: no display specified
-
eddy
- Сообщения: 3321
- Статус: Красный глаз тролля
- ОС: ArchLinux
- Контактная информация:
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
eddy » 23.02.2011 12:38
Код: Выделить всё
ssh ishtar.sao.ru
...
echo $DISPLAY
localhost:10.0
Все работает. Может, у вас ssh-сервер не разрешает передачу иксов? «ForwardX11 yes» в настройках есть? Еще попробуйте ssh -X, может, поможет…
RTFM
——-
KOI8-R — патриотичная кодировка
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 23.02.2011 12:44
eddy писал(а): ↑
23.02.2011 12:38
Код: Выделить всё
ssh ishtar.sao.ru ... echo $DISPLAY localhost:10.0
Все работает. Может, у вас ssh-сервер не разрешает передачу иксов? «ForwardX11 yes» в настройках есть? Еще попробуйте ssh -X, может, поможет…
А где настройки forward X11 делать? а то ssh -Х не получается
pol@pol:~$ ssh -X alabama@192.168.1.5
alabama@192.168.1.5’s password:
Linux ubuntu 2.6.35-22-generic-pae #33-Ubuntu SMP Sun Sep 19 22:14:14 UTC 2010 i686 GNU/Linux
Ubuntu 10.10
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
79 packages can be updated.
46 updates are security updates.
Last login: Wed Feb 23 14:42:48 2011 from pol.local
alabama@ubuntu:~$ firefox
Error: no display specified
alabama@ubuntu:~$
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 23.02.2011 12:48
eddy писал(а): ↑
23.02.2011 12:44
Посмотрите в /etc/ssh/ssh_config
вот конфиг последнего компьютера
Host *
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 23.02.2011 13:13
mailman137 писал(а): ↑
23.02.2011 12:59
А сервер разрешает пересылку?
Код: Выделить всё
sh-3.2$ ssh -X nix@10.1.1.5 cat /etc/ssh/sshd_config | grep -i X11 nix@10.1.1.5's password: X11UseLocalhost yes X11Forwarding yes X11DisplayOffset 10 sh-3.2$
Не могу отредактировать
nano примените.
Вот что имеем
sh-3.2$ ssh -X nix@10.1.1.5 cat /etc/ssh/sshd_config | grep -i X11
sh-3.2$: команда не найдена
alabama@ubuntu:~$ nix@10.1.1.5’s password:
> X11UseLocalhost yes
> X11Forwarding yes
> X11DisplayOffset 10
> sh-3.2$
-
eddy
- Сообщения: 3321
- Статус: Красный глаз тролля
- ОС: ArchLinux
- Контактная информация:
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
eddy » 23.02.2011 13:33
pavlar писал(а): ↑
23.02.2011 13:22
Что то nano криво работает я захожу под sudo а записать не могу : нет прав пойду схожу на компьютер на месте подправлю если кто пришел уже
Вы какие команды выполняете? Зайдите просто на компьютер по ssh. Перелогиньтесь в рута (su -), затем при помощи vim или nano отредактируйте файл. Перезапустите ssh-server. Завершите сессию. Зайдите снова. Иксы должны перенаправляться.
RTFM
——-
KOI8-R — патриотичная кодировка
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 23.02.2011 15:18
eddy писал(а): ↑
23.02.2011 13:33
pavlar писал(а): ↑
23.02.2011 13:22
Что то nano криво работает я захожу под sudo а записать не могу : нет прав пойду схожу на компьютер на месте подправлю если кто пришел уже
Вы какие команды выполняете? Зайдите просто на компьютер по ssh. Перелогиньтесь в рута (su -), затем при помощи vim или nano отредактируйте файл. Перезапустите ssh-server. Завершите сессию. Зайдите снова. Иксы должны перенаправляться.
Вот новый конфиг
# ForwardAgent no
ForwardX11 yes
# ForwardX11Trusted yes
Я перегрузил систему и всё равно то же самое
Я так понял что эти преобразования надо делать на всех промежуточныых компьютерах потому что на них стоит ForwardX11 no. А нет ли какой программы как в Windows наподобие Xming 7.5.0.32 ?
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 24.02.2011 08:33
Поставил я этот VNC сервер. Но что-то на вид он корявый, непонятно как сним работать?
Где выбирать IР компьютера экран которого хочешь подключить?А если я хочу с экрана компьютера внешней сети увидеть в графике экран компьютера внутренней сети, прицепленной ко второй сетевой карте удаленного компьютера то вообще полный мрак
-
SLEDopit
- Модератор
- Сообщения: 4814
- Статус: фанат консоли (=
- ОС: GNU/Debian, RHEL
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
SLEDopit » 24.02.2011 12:09
pavlar писал(а): ↑
24.02.2011 11:37
SSH это тоже сервер
Код: Выделить всё
$ dpkg -l | grep ssh
ii openssh-client 1:5.5p1-6 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:5.5p1-6 secure shell (SSH) server, for secure access from remote machines
заметьте, стоит два пакета: client и server. и когда вы вбиваете ssh user@ip используется именно клиент, который подключается к серверу.
в vnc точно так же. на это watashiwa_daredeska вам и намекал.
UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. © Dennis Ritchie
The more you believe you don’t do mistakes, the more bugs are in your code.
-
Bizdelnick
- Модератор
- Сообщения: 19853
- Статус: nulla salus bello
- ОС: Debian GNU/Linux
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
Bizdelnick » 24.02.2011 12:19
pavlar писал(а): ↑
24.02.2011 11:37
SSH это тоже сервер и здесь в командной строке я просто набираю IP адрес подключаемого компьютера
Набиваете в командной строке клиента, а не сервера. Сервер — на той машине, к которой подключаетесь.
Вообще не очень понял, зачем нужен VNC в данном случае. По первоначальному вопросу — почитайте это.
Пишите правильно:
в консоли вку́пе (с чем-либо) в общем вообще |
в течение (часа) новичок нюанс по умолчанию |
приемлемо проблема пробовать трафик |
-
pavlar
- Сообщения: 36
- ОС: Ubuntu 10.10
Re: Решено: Как задать экран на удаленном компьютере?
Сообщение
pavlar » 24.02.2011 12:45
Bizdelnick писал(а): ↑
24.02.2011 12:19
pavlar писал(а): ↑
24.02.2011 11:37
SSH это тоже сервер и здесь в командной строке я просто набираю IP адрес подключаемого компьютера
Набиваете в командной строке клиента, а не сервера. Сервер — на той машине, к которой подключаетесь.
Вообще не очень понял, зачем нужен VNC в данном случае. По первоначальному вопросу — почитайте это.
Всё в порядке я просто забыл прописать форварды на своем компьютере в ssh_config. А теперь я просто захожу по ssh на удаленный компьютер и запускаю для проверки firefox @ а на моем экране появляется новое окно с запущенным фоксом
Всем спасибо
Почитай хоть что-нибудь про Х-ы и роль переменной DISPLAY
anonymous
(25.04.13 09:07:28 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 09:07:28 MSK
Я читал, попробовал вот как здесь написано — ноль результатов (читал не только там, но всё равно не работает).
Dima98
(25.04.13 10:03:12 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от Dima98 25.04.13 10:03:12 MSK
Показывай команды которые даешь на обеих системах.
И возможно ssh -X решит твои проблемы без понимания сути процессов.
anonymous
(25.04.13 10:09:12 MSK)
- Показать ответ
- Ссылка
со своего компьютера захожу на другую машину
заходишь как?
Elyas ★★★★★
(25.04.13 10:10:29 MSK)
- Ссылка
Приветствую жителей форума, я со своего компьютера захожу на другую машину дабы с неё запустить FF у себя, но проблема в том, что в консоли у меня пишется, что display не указан
дык укажи. И пробросить его не забудь, дабы иксы с одной машины, работали на другой.
для ssh
-X Enables X11 forwarding. This can also be specified on a per-host
basis in a configuration file.
X11 forwarding should be enabled with caution. Users with the
ability to bypass file permissions on the remote host (for the
user’s X authorization database) can access the local X11 display
through the forwarded connection. An attacker may then be able
to perform activities such as keystroke monitoring.
For this reason, X11 forwarding is subjected to X11 SECURITY
extension restrictions by default. Please refer to the ssh -Y
option and the ForwardX11Trusted directive in ssh_config(5) for
more information.
- Показать ответ
- Ссылка
Ответ на:
комментарий
от drBatty 25.04.13 10:12:54 MSK
И пробросить его не забудь, дабы иксы с одной машины, работали на другой.
Думай что пишешь
anonymous
(25.04.13 10:25:12 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 10:09:12 MSK
1)
[spvl@tau ~]$ xhost +alpha.istra.ru
[spvl@tau ~]$ slogin -l root alpha
2)
[root@alpha ~]# export DISPLAY=tau.istra.ru:0.0
[root@alpha ~]# firefox
Error: cannot open display: tau.istra.ru:0.0
Dima98
(25.04.13 10:30:21 MSK)
- Показать ответы
- Ссылка
Ответ на:
комментарий
от Dima98 25.04.13 10:30:21 MSK
X на tau не слушает порт tcp/6000
вместо slogin используй ssh -X -l root alpha
anonymous
(25.04.13 10:33:50 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 10:25:12 MSK
И пробросить его не забудь, дабы иксы с одной машины, работали на другой.
Думай что пишешь
что не так? ТС вроде и хочет, что-бы на машине А будет работать фаерфокс, а управлять/смотреть он хочет на машине Б? Или я неправильно его понял?
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 10:33:50 MSK
slogin это линк на ssh, так что просто добавь -X
anonymous
(25.04.13 10:35:10 MSK)
- Ссылка
Ответ на:
комментарий
от Dima98 25.04.13 10:30:21 MSK
Ответ на:
комментарий
от drBatty 25.04.13 10:34:16 MSK
понял правильно, терминология не правильная.
«пробросить его» ???
«иксы с одной машины, работали на другой» — ??? — Хсервер -> Хсервер (я думал Xclient->Xserver не?)
anonymous
(25.04.13 10:36:53 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 10:36:53 MSK
понял правильно, терминология не правильная. «пробросить его» ???
ну это я так «forwarding» перевёл. Вроде уже устоявшийся перевод, не? Хотя и жаргон конечно.
я думал Xclient->Xserver не?
да. Конечно. Вот только Xserver где-то удалённо, и надо принять меры для того, что-бы клиент смог его найти. Т.е. запросы от/к серверу надо перенаправить(forwarding) на tau. Ssh сама так умеет, с ключом -X (или -Y).
- Показать ответ
- Ссылка
Ответ на:
комментарий
от drBatty 25.04.13 10:51:15 MSK
Вот только Xserver где-то удалённо
Xserver в 99.99% случаев локален (там где монитор и клава с мышью)
anonymous
(25.04.13 10:55:38 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 10:55:38 MSK
Xserver в 99.99% случаев локален (там где монитор и клава с мышью)
ну да. И ФФ и будет долбиться в _свой_ локальный сервер. А не в тот, где монитор с клавой. А надо, что-бы оно завернулось в ssh, на другой комп.
- Показать ответы
- Ссылка
Ответ на:
комментарий
от Elyas 25.04.13 10:35:21 MSK
не знаю, может да, может нет — это можно ка-нибудь посмотреть?
Пробовал ssh с -X и с -Y ничего не меняется
Dima98
(25.04.13 11:05:37 MSK)
- Показать ответы
- Ссылка
Ответ на:
комментарий
от drBatty 25.04.13 11:04:43 MSK
drBatty верно говорит мне нужно чтобы FF с того компа (без мыши и клавы) в графическом виде пришёл ко мне на комп
Dima98
(25.04.13 11:07:41 MSK)
- Ссылка
Ответ на:
комментарий
от Dima98 25.04.13 11:05:37 MSK
Если через ssh -X, то xhost и Xorg, слушающий сеть не нужны.
При корректной работе после логина через ssh -X переменная DISPLAY будет уже установлена в значение, нужное для перенаправления соединений X11 через ssh туннель.
Можно сразу запускать программы.
Elyas ★★★★★
(25.04.13 11:20:20 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от Elyas 25.04.13 11:20:20 MSK
Спасибо, прояснили заработало!
Спасибо огромное всем кто отписался вы мне очень помогли!
Dima98
(25.04.13 11:34:41 MSK)
- Ссылка
Ответ на:
комментарий
от Dima98 25.04.13 11:05:37 MSK
Пробовал ssh с -X и с -Y ничего не меняется
В клиенте оно должно быть ЯВНО разрешено
man ssh_config
ForwardX11
Specifies whether X11 connections will be automatically redirected over the secure channel and DISPLAY set. The
argument must be «yes» or «no». The default is «no».
X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote
host (for the user’s X11 authorization database) can access the local X11 display through the forwarded connection.
An attacker may then be able to perform activities such as keystroke monitoring if the ForwardX11Trusted option is
also enabled.
- Ссылка
Ответ на:
комментарий
от drBatty 25.04.13 11:04:43 MSK
«Локальный» означает для пользователя, а не приложения. Меня удивляет твой «дибилизм» в последнее время во всех темах.
anonymous
(25.04.13 12:15:48 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 12:15:48 MSK
«Локальный» означает для пользователя, а не приложения. Меня удивляет твой «дибилизм» в последнее время во всех темах.
а меня — твой. Откуда ФФ знать, что он для какого-то пользователя не локальный? Он и не знает. И не работает потому.
- Показать ответ
- Ссылка
Ответ на:
комментарий
от drBatty 25.04.13 12:36:58 MSK
Не, ну тебе реально ЧСВ мозг выдавило!
Локальный/удаленный оно для пользователя в данном случае, файерфоксу прозрачно где и с кем работать.
Да,да, сынок, это и есть сетевая прозрачность Х’ов.
anonymous
(25.04.13 14:22:27 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 25.04.13 14:22:27 MSK
Да,да, сынок, это и есть сетевая прозрачность Х’ов.
по твоему, любой может вот просто так войти в твои иксы? А нафейхуя я man xhost читал?
файерфоксу прозрачно где и с кем работать.
фаерфоксу-то прозрачно, а вот твоим иксам — вряд-ли. Они работают исключительно со своим локальным юзером, который эти иксы и запустил. Даже другой локальный юзер будет послан. Т.ч. либо ты xhost’ом правишь список доступа, либо пробрасываешь иксовые запросы через ssh-клиент. Причём этот клиент нужно будет запустить локально для X-сервера, и от того же юзера, кто иксы запустил. Ну и конечно с опцией -X, ибо по умолчанию эта проброска(forwarding) не работает.
- Ссылка
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Installation tutorial
Firefox:75.0
Geckodriver:0.26.0
Selenium:3.141.0
The above is the version I configured
Click the tutorial link
First, take a look at the corresponding configuration of geckodriver, selenium, and firefox
Special attention: as long as you install it according to the corresponding version, you don’t have to question it after you report an error. The answers you search basically say that the corresponding version number is incorrect; I have encountered a lot of problems, but in the end it is not the reason at all. I tried it many times.
match
2. Download different versions of firefox
Different versions of firefox address
Ps: Find a lot of websites are the latest version of firefox, because it needs to match selenium, it is very inconvenient to use, here is how to download linux
wget http://releases.mozilla.org/pub/firefox/releases/75.0b7/linux-x86_64/en-US/firefox-75.0b7.tar.bz2 (wget + directly right click to copy the link address)
1) Unzip
sudo tar -xjvf firefox-75.0b7.tar.bz2 -C /usr/lib/
2) Modify owner and my firefox is under /usr/lib
sudo chown -R root:root /usr/lib/firefox
3) Delete the original link
sudo unlink /usr/bin/firefox
4) Establish a new link:
sudo ln -s /usr/lib/firefox/firefox /usr/bin/firefox
Three, install selenium
conda install selenium=3.141.0
Download according to different versions, pip is also possible, personally think that the dependency of anaconda is still very useful, worry-free, and avoid dependency installation errors;
Fourth, install geckodriver
Corresponding to different versions of geckodriver
wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
(Also right-click and copy the link address to download)
tar --xvzf geckodriver-v0.26.0-linux64.tar.gz
rm -rf geckodriver-v0.26.0-linux64.tar.gz
chmod +x geckodriver
sudo cp geckodriver /usr/local/bin/
Five, test whether the installation is successful
python
from selenium import webdriver
driver = webdriver.Firefox()
Installed without error!
Error: no DISPLAY environment variable specified error
Error: selenium.common.exceptions.WebDriverException: Message: invalid argument: can’t kill an exited process
The results of the online search were that the version did not correspond. In the end, I was smashed. I always thought that there was a problem with the version. Various changes were still not possible. Finally, I found an error in geckodriver.log: no DISPLAY environment variable specified
The basic answer is also inconsistent with the version! 【Crazy】
solution:
sudo apt-get install xvfb
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 & export DISPLAY=":99"
Ps: Finally, I tried the above code and finally solved the problem;
Solution source stackoverflow
Xiaobai, who has not installed under Linux, will definitely report error and entangled version like me. The main reason is that the tutorial is not detailed and old. As long as you follow the link I pushed above to match and install it, it will not be a version issue. So I hope everyone can avoid detours;