Firefox with selenium-webdriver requests port without url - selenium

I am trying to open an url with selenium-webdriver 4.5.0 and geckodriver 0.31.0. My code is as follows:
require 'selenium-webdriver'
require 'test-unit'
def setup
options = Selenium::WebDriver::Firefox::Options.new(args: ['-headless'])
return Selenium::WebDriver.for :firefox, options: options
end
#url = 'https://www.google.com'
#driver = setup
#driver.navigate.to #url
When I run this code, a firefox browser opens (despite the headless option) and only the port is entered into the url bar (see image below). Firefox displays this error message
Firefox can't establish a connection to the server at 9222.
How do I fix this?

Related

Can't use URLs mapped in /etc/hosts for Webdriver.io

I'm using webdriver for my integration tests. I want to run the test suite for the url:
https://test.url.net
but I have some constraints that are beyond my control.
I need to run the tests on my local environment.
I cannot use localhost as my url
I solved this by adding an entry in /etc/hosts/ to map localhost to my url
$ cat /etc/hosts
127.0.0.1 test.url.net
when I run webdriver targeting https://test.url.net it just hangs and cannot connect, however, when I try to target https://localhost:443/ the test opens (and fails due to the constraint that we can't use localhost as a domain).
Is there a way to provide webdriver with a mapping of url to ip address?
https://test.url.net is directing only 127.0.0.1 / localhost. But you have to mention the port number.
try https://test.url.net:443 in browser manually and check if the website loads.
if yes then use this url with port number in webdriver.io

Virtual host blocked on Chrome with Privacy Error

I'm using my localhost xampp with Apache, ports 80, 443. I've configured virtual host for my local application through some domain name, Recently chrome got updated to Version 63.0.3239.84 and while fetching the application it is throwing Privacy Error:
And while fetching the directly from the local host url, like localhost/phpmyadmin it opens the page:
I followed localhost blocked on Chrome with "Privacy Error" and tried configuring as suggested which was already enabled
Help me out with this.
I had the same problem. I fixed by changing my vhost from *.dev to *.local.
See Virtual host being redirected to https://adminboard.app in google chrome

I can not run xdebug in xampp server with eclipse?

Deal all,
I am new babe in php, and I am working yii framework.for the server,I use xampp (PHP Version 5.4.22) and the eclipse to write code, now I want to debug on eclipse by xdebug and I have open some lines in php.ini:
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
after I have breakpoint and run debug in eclipse, it run this url:
http://localhost/ktbeauty/themes/classic/views/admin/login.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=13918210553298
and the page shows like that:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.7 (Win32) OpenSSL/0.9.8y PHP/5.4.22
Can you tell me what it is wrong ?and How Can I fix to run xdebug in xampp with eclipse?
thankyou very much

Cucumber disable proxy and use direct connection

I am trying to write a cucumber test which uses Watir Webdriver and selenium with the Headless gem.
I get the error:
Timeout::Error: Timeout::Error
from /var/lib/jenkins/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:140:in `rescue in rbuf_fill'
When trying to open a page on a hostname that is mapped to a local connection (custom hostname mapped to 127.0.0.1) which is then set up as a virtual server in Apache.
I have a default system proxy which needs to be avoided for this connection because it should not use the proxy for local connections. I have already added the ignore proxy host to my ubuntu configuration.
How can I tell my Watir firefox profile NOT to use a proxy and instead direct connection. Or, how can I tell the profile to ignore the proxy for the custom hostname?
Everywhere in the documentation just mentions setting up a proxy, not how to disable it or how to ignore hosts in it.
The code I have is:
require 'watir-webdriver'
require 'headless'
Headless.new.start
b = Watir::Browser.new
b.goto 'http://gi-local'
Which then times out on the goto.
I have also tried adding:
profile = Selenium::WebDriver::Firefox::Profile.new
profile['network.proxy.no_proxies_for']='localhost, 127.0.0.1, gi-local'
b = Watir::Browser.new :firefox, :profile => profile
b.goto 'http://gi-local'
But this still times out.
Solved. Needed to set all the proxy settings, not just the no_proxies part and also make sure to use numbers for ports instead of strings.

Cannot Connect to Localhost in Windows

How can I access my local phpmyadmin with my web browser? I tried it on both Firefox and Chrome and both cannot load. I have XAMPP and I am working on Vista.
Is your XAMPP working?
Try: http://localhost/
You should see the XAMPP console and from there you can go to phpmyadmin.
If you don't see the console is because XAMPP is not running.
Try to check the port that you using :
Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf.
Then search for the string “ServerName”
For example in my httpd.conf the result is : ServerName localhost:8081
Then I use http://localhost:8081/phpmyadmin