i know this problem is very easy for you, but at me is very difficult
i want make autotesting my web by android driver
and i found this
https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android
so I installed for starting android test
selenium server - https://www.seleniumhq.org/download/
java - https://www.java.com/ko/download/windows-64bit.jsp
facebook/php-webdriver - https://github.com/facebook/php-webdriver
laravel - in console
android studio -https://developer.android.com/studio/install?hl=ko
and i did setup Environment in my computer, like below this
finally i start selenium server in my console like below
' $ java -jar selenium ~~~~~~ '
and testing is success by desktop chrome driver.
but it is failed for android driver
my code about selenium is
/ start Chrome with 5 second timeout
$host = 'http://localhost:4444/wd/hub';
$capabilities = DesiredCapabilities::android();
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
$driver->get('https://www.seleniumhq.org/');
it is fail and error code is
Unable to create session from { "desiredCapabilities": { "browserName":
"android", "platform": "ANDROID" }, "capabilities": { "firstMatch": [ {
"browserName": "android", "platformName": "android" } ] } } Build info:
version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'DESKTOP-N27RM9V', ip: '192.168.0.4', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211' Driver
info: driver.version: unknown
how can i solve here situation
help me,,,,,, please tell me how can solve this,,,,,
I hope you understand if I make a mistake because my english level is very low and thanks you for reading
Related
Is it possible to run tests on Edge browser using Mink Selenium2 driver and Selenium 4 grid ?
I've tried using:
default:
suites:
default:
filters:
tags: ~#wip
paths: ['%paths.base%/storage/features']
gherkin:
cache: ~
extensions:
Behat\MinkExtension:
base_url: http://www.google.com
javascript_session: selenium2
browser_name: edge
selenium2:
capabilities:
browserName: MicrosoftEdge
browser: edge
extra_capabilities:
edgeOptions:
args:
- "--no-sandbox"
- "--disable-dev-shm-usage"
- "--headless"
- "--disable-gpu"
- "--dns-prefetch-disable"
- "--disable-setuid-sandbox"
- "--window-size=1920,1080"
- "--remote-debugging-port=9222"
But this gives me some errors saying that the DevToolsActivePort file does not exist:
13:38:41.079 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
13:38:41.086 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
13:38:41.942 INFO [NodeOptions.getSessionFactories] - Detected 8 available processors
13:38:41.970 INFO [NodeOptions.discoverDrivers] - Discovered 3 driver(s)
13:38:41.997 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge"} 8 times
13:38:41.999 INFO [NodeOptions.report] - Adding Chrome for {"browserName": "chrome"} 8 times
13:38:42.000 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox"} 8 times
13:38:42.039 INFO [Node.<init>] - Binding additional locator mechanisms: id, relative, name
13:38:42.067 INFO [LocalDistributor.add] - Added node fb3c75f0-847d-475d-88b0-dea6893c09c2 at http://172.19.0.7:4444. Health check every 120s
13:38:42.068 INFO [GridModel.setAvailability] - Switching node fb3c75f0-847d-475d-88b0-dea6893c09c2 (uri: http://172.19.0.7:4444) from DOWN to UP
13:38:42.251 INFO [Standalone.execute] - Started Selenium Standalone 4.0.0 (revision 3a21814679): http://172.19.0.7:4444
Starting MSEdgeDriver 95.0.1020.30 (09f7018e2a65a55dea3a0a261efca40ae03471ed) on port 36979
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
[1634828868.563][SEVERE]: bind() failed: Cannot assign requested address (99)
15:07:48.749 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "49c55d39b0c26898585047f89ad32f33","eventTime": 1634828868685689900,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:36979","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: MSEdge failed to start: exited abnormally.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from msedge location \u002fusr\u002fbin\u002fmicrosoft-edge is no longer running, so MSEdgeDriver is assuming that MSEdge has crashed.)\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'dee4c77efe99', ip: '172.19.0.7', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '11.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: MSEdge failed to start: exited abnormally.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from msedge location \u002fusr\u002fbin\u002fmicrosoft-edge is no longer running, so MSEdgeDriver is assuming that MSEdge has crashed.)\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'dee4c77efe99', ip: '172.19.0.7', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.25-linuxkit', java.version: '11.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:131)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:65)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:315)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:513)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:440)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:648)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:612)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"MicrosoftEdge\"}\n"}}```
is there any way to make this work ?
Please make sure you have
127.0.0.1 localhost
in your /etc/hosts file.
To check it, you should go to the terminal and run
sudo vi /etc/hosts
type your user password and paste
127.0.0.1 localhost
to an empty row.
Additionally, please make sure you have ChromeDriver -or the driver of the browser you intend to use- is installed and your program knows the path of ChromeDriver.
You can follow the steps explained here https://www.browserstack.com/guide/run-selenium-tests-using-selenium-chromedriver.
For DevToolsActivePort error try another workaround: add --remote-debugging-port=
I tried a different version of Selenium server with Edge, including version 4, till version 3.5; it is working fine, and above, it gives different errors. I can see that Selenium 4 is in alpha release at the Maven repository, and all other versions were released in October 2021. I would recommend that you use an earlier version for some time. You can refer to this article for the configuration of Edge with Behat Mink Selenium 2.
I have a problem with web driver startup for selenium on Ubuntu 14.04.
I've already installed Oracle JDK and Selenium Standalone Server, also have no issue with running Selenium Standalone Server on Ubuntu 14.04 (I use cloud9 VDS).
But when I try to run this example an error occurs (Unable to create new service):
Fatal error: Uncaught exception 'Facebook\WebDriver\Exception\SessionNotCreatedException' with message ' in /home/ubuntu/workspace/php-web-driver-test/vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 154 Facebook\WebDriver\Exception\SessionNotCreatedException: Unable to create new service: ChromeDriverService Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'user-selenium-6138185', ip: '173.18.0.42', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.80-c9', java.version: '1.8.0_171' Driver info: driver.version: unknown in /home/ubuntu/workspace/php-web-driver-test/vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 154 Call Stack: 0.0005 234144 1. {main}() /home/ubuntu/workspace/php-web-driver-test/test-1.php:0 0.0020 307072 2. Facebook\WebDriver\Remote\RemoteWebDriver::create() /home/ubuntu/workspace/php-web-driver-test/test-1.php:11 0.0030 387224 3. Facebook\WebDriver\Remote\HttpCommandExecutor->execute() /home/ubuntu/workspace/php-web-driver-test/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126 0.1971 486960 4. Facebook\WebDriver\Exception\WebDriverException::throwException() /home/ubuntu/workspace/php-web-driver-test/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:320
Also there is some response from Selenium Server:
06:04:33.192 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
06:04:33.194 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-05-16 06:04:33.330:INFO::main: Logging initialized #566ms to org.seleniumhq.jetty9.util.log.StdErrLog
06:04:33.641 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
06:04:42.085 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {browserName: chrome}
06:04:42.088 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
I don't know why such an error occurs, may be I have to force browser headless mode option or specify exact firefox or chrome location for web driver?
I am trying to test some javascript functionality in my Symfony Application. I tried looking at Mink for this:
http://mink.behat.org/en/latest/.
I ran a composer require for behat/mink, behat/mink-goutte-driver, and behat/mink-selenium2-driver.
I then tried to install Selenium in my ubuntu 16.04 dev enviroment.
I've got a bash script that installs java8, selenium 3.9, openjdk-8-jdk-headless, firefox, xvfb and geckodriver 0.18.0. I seem to start up the selenium server OK.
However, when I then try to start a session with Mink in my tests, I am seeing the following:
Behat\Mink\Exception\DriverException: Could not open connection: Unable to find a matching set of capabilities
Build info: version: '3.9.0', revision: '698b3178f0', time: '2018-02-05T14:56:13.134Z'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.60-linuxkit-aufs', java.version: '1.8.0_161'
Driver info: driver.version: unknown
Caused by
WebDriver\Exception\SessionNotCreated: Unable to find a matching set of capabilities
Build info: version: '3.9.0', revision: '698b3178f0', time: '2018-02-05T14:56:13.134Z'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.60-linuxkit-aufs', java.version: '1.8.0_161'
Driver info: driver.version: unknown
I'm trying to start my session in my test class like this:
// Choose a Mink driver. More about it in later chapters.
$driver = new \Behat\Mink\Driver\Selenium2Driver();
$session = new \Behat\Mink\Session($driver);
// start the session
$session->start();
I assume my problem is to do with the versions of java/firefox/selenium/ geckodriver incompatible with each other? But I can't seem to be able to fix it by trying out other versions... Is anyone able to help?
(This is my first ever question here, so let me know if if isn't great and I will try to improve it!)
I have used selenium 2.53.3 with nodejs.
to move mouse to particular button I have used
mouseMove(elem) function. ex:
driver.actions().mouseMove(elem).click().perform();
Some time it works and some time it not, what is the matter.
Some time I have got following error:
POST /session/67809eeb-fa66-489d-84de-ab8426e6c796/moveto did not match a known command Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700' System info: host: '185-129-70-172', ip: '185.129.70.172', os.name: 'windows', os.arch: 'x86', os.version: '6.2', java.version: '1.8.0_101' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{raisesAccessibilityExceptions=false, browserstack.selenium.jar.version=3.0.1, appBuildId=20161104212021, moz:firefoxOptions={args=[], profile=UEsDBBQACAgIAKQ4MEoAAAAAAAAAAAAAAAAHAAAAdXNlci5qc51Xy27jNhTd9ysKr1qgZpNJZ9Ou0kwGKDBoinGDWRIUeWUxpkiWD8v++15S0vilh52VJZnkfZ1z72H04Kh1UP60KJxp8I14VkJ+lnpNaqYa5oCAZoUCsfjlx5IpDz//8UM87BQs4BprXEhbKmAqVO07wUVbyWf295YrUBbco7WeaNjik9+gN1v413ySfoN7F8xaJTkL0uhfd8rvFqcHaQiNcRtShWCJraSv9sv0t2XeLxXodajwlA8fPw7bd8AE/ggIwAOIz9L58IhBcQW4Lbh4HrepMUE7yitnaqCeO2kDdVHTIOu05eFu2FB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2r30NJU6aNtld5Bh/4PUEsHCEpq6ooxBAAAaQ8AAFBLAQIUABQACAgIAKQ4MEpKauqKMQQAAGkPAAAHAAAAAAAAAAAAAAAAAAAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAGYEAAAAAA==}, platform=XP, specificationLevel=0, browserstack.video.disableWaterMark=true, acceptSslCerts=false, processId=492, browserstack.key=ShpoHTMYgjRnvvprcvm4, browser=firefox, browserVersion=50.0, platformVersion=6.2, acceptSslCert=false, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, browser_version=50.0, platformName=windows_nt, 64bit=true, browserstack.debug=false, rotatable=false, browserstack.ie.noFlash=false, firefoxOptions={args=[], profile=UEsDBBQACAgIAKQ4MEoAAAAAAAAAAAAAAAAHAAAAdXNlci5qc51Xy27jNhTd9ysKr1qgZpNJZ9Ou0kwGKDBoinGDWRIUeWUxpkiWD8v++15S0vilh52VJZnkfZ1z72H04Kh1UP60KJxp8I14VkJ+lnpNaqYa5oCAZoUCsfjlx5IpDz//8UM87BQs4BprXEhbKmAqVO07wUVbyWf295YrUBbco7WeaNjik9+gN1v413ySfoN7F8xaJTkL0uhfd8rvFqcHaQiNcRtShWCJraSv9sv0t2XeLxXodajwlA8fPw7bd8AE/ggIwAOIz9L58IhBcQW4Lbh4HrepMUE7yitnaqCeO2kDdVHTIOu05eFu2FBghSeYV/2in5TxMJ0WYRqtDBNoS7N1qlBlmm8V6BWmPaV8eLtFp2zwyRitjWBqpoiwDcYoT8A547jR3qjjul2G7+VaG41Zq6EuwK3yq5+OxYP3WDwfDILKgY+YtxIdpdwxX90OD2NBf5a5PnPg6I9RUrf7KOwCOM1UwsTNiC4TOr5GPexzA4VwEp2kjHNAVESNCfSIKsrBhZksCemtYnsQz/d3q78NIjAF+NvwYvwkXvQ3qREn/v6OSLRkXr9+ySkpTAy/F4rpzeISu21ElClF3zxmIzkq2xJeVntnJZYN15KmkgGU9AEP+C9KN4aoBKeNDKRjZY9eDC5hatDI9xoxrAwSaRqyPuE/WlIh+yyeTRtQPDExulTTxVnIqdw6o49EixUGojG15f4Vl4wYAB6dDPvMVbqV0CAcaC13IDIJqdF8hLwTCIo2sfl5MrLecInYxifig5M8UOPkWmpqDQJ9P40hDQ0yn3SpmADCiaPtySR9XMWilpmt/+SPjxnI182AwWMmI/7eILqapnriypEGeuAwhtlk6F+S2JQlroMlSx0DgYv1KvZUQMmiCsMdrU8797aD3jXAAI1oTchogG2GN1xibxLZPXWQZ9hdg9uTtpvn9R/m1k6TZtj1/BnmUN3n//n1yyN5IOwAictkvrEta0fi5BQ5L3xP5mnUXgbt4C1P7UkjLSnS8bckSQHbXp+jo1KzGJJ0SYZWHOGaOuv93dikaD2iGifYFihOOB2GW/GAjHhBLsy6UyjDN7lxvzv4m/vknBxgjlcdJeZUUE1aphMRazuJKWT8VTQ7gbPBGjgphgfTRUM+78QPw0q0HXrLvhUhyEOcGf7d2pE220nOea15pEB8llkHBYLtOOaRN5m5BN5hJ46YbVrFkDnxl35qVePgySfaHENYosTUyNi0fYm6bpmEVfbqnCGTHWs8TZ3OoHlMiJj3pMF7c0e/til6FKiK8Ar45lM7ZP5s/7ldvRAmhEypYTPTe/DS9t7LmjLrdfrYif/JeX3UVnLETziesHEVUqUkarmughpRKKep9kkfBIricqKeR9Z6J98zU2jPcVLjDSRzbJFuLWh2TOymSw5yFq8qM2r30NJU6aNtld5Bh/4PUEsHCEpq6ooxBAAAaQ8AAFBLAQIUABQACAgIAKQ4MEpKauqKMQQAAGkPAAAHAAAAAAAAAAAAAAAAAAAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAGYEAAAAAA==}, browserstack.user=jasontownesfrenc1, version=50.0, proxy={}, command_id=1, firefox_binary=c:\Program Files (x86)\firefox 50.0\firefox.exe, browserstack.video=true, orig_os=win8, takesElementScreenshot=true, firefox_profile=UEsDBBQACAAIAJgwMEoAAAAAAAAAA..., proxy_type=node}] Session ID: 67809eeb-fa66-489d-84de-ab8426e6c796
So I'm starting out with PHPUnit and Selenium 2
public function testHasALoginForm()
{
$this->url('/login');
$username = $this->byName('username');
$password = $this->byName('password');
$this->assertEquals('', $username->value());
$this->assertEquals('', $password->value());
}
This only happens when I call the value() method from the element and I end up getting:
1) test\view\LoginTest::testHasALoginForm
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: GET /session/fdcf0669-1d42-4a35-8e7a-29dec4a0f1e4/element/0/value
Build info: version: '2.42.1', revision: '68b415a', time: '2014-05-29 16:16:49'
System info: host: 'Something.local', ip: '192.168.1.108', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.3', java.version: '1.8.0_05'
Driver info: driver.version: unknown
Am I doing something wrong?
The ->value() method has been removed in selenium v2.42.0. The currently recommended solution is to use $element->attribute('value')
#see https://code.google.com/p/selenium/source/detail?r=953007b48e83f90450f3e41b11ec31e2928f1605
Hi i'm getting exactly the same error with roughly the same code. I am using the same version of selenium as you are.
However I did not get this error when using the 2.39.0 version.
Hence it seems to be either a regression or a deprecated use.