I'm using this command to run tests in my application:
pub run angular_test --test-arg=--tags=aot --test-arg=--platform=dartium --test-arg=--reporter=expanded --serve-arg=--hostname=192.168.173.1 --serve-arg=--port=8180 --verbose
But when my tests run, I got this:
Failed to load "test\app_test.dart":
Error getting http://localhost:8180/app_test.dart.browser_test.dart: The remote computer refused the network connection.
(errno 1225)
Make sure "pub serve" is running.
How I can change the call to localhost? Should not the call follow --serve-arg=--hostname=192.168.173.1 config?
Thanks!
Related
We're running wdio tests using wdio (both for local run & browserstack based devices)
When I run browserstack (server run) I am getting following error:
[11:41:04] COMMAND POST "/wd/hub/session"
[11:41:04] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"name":"Ping","build":"1.0","browserstack.debug":true,"device":"Samsung Galaxy S8","os_version":"7.0","requestOrigins":{"url":"http://webdriver.io","version":"4.14.2","name":"webdriverio"}}}
ERROR: connect ECONNREFUSED 127.0.0.1:4444
My dependency stack
We use yarn
"wdio-allure-reporter": "0.8.3",
"wdio-appium-service": "^0.2.3",
"wdio-browserstack-service": "^0.1.18",
"wdio-cucumber-framework": "2.2.8",
"wdio-dot-reporter": "0.0.10",
"wdio-mocha-framework": "^0.6.4",
"wdio-screenshots-cleanup-service": "0.0.7",
"wdio-spec-reporter": "^0.1.4",
"wdio-visual-regression-service": "^0.9.0",
"webdriverio": "4.14.2"
I have tried troubleshooting tip mentioned on below documentation, but no affect.
Kindly advise what might be the reason tests are not running either locally & not on server.
Troubleshooting tip
The error you're seeing is because wdio is trying to reach out to a WebDriver server on "127.0.0.1:4444", which is the default local server (i.e. not Browserstack).
This means you likely don't have your user/key set up in your wdio.conf.js file. WebdriverIO relies on the user/key to determine what default server to use.
Check your config that both user and key are set. More info is available here:
http://v4.webdriver.io/guide/services/browserstack.html
Is there a way I can get appium to startup within the code? I am trying to automate an iOS application, Since appium only needs to run when my test is running it doesnt make sense to me to keep the appium server always going.
Right now I am using Appium GUI to start server.Is it possible to add something in Before method to start the appium server before connecting the WebDriver to it, and then terminating it in the After method.
Please help me to do it in Mac using Ruby.
Appium server version: 1.8.0
Mac OS: 10.13
node: 6.11
Ruby: 2.5.1
Thanks in advance,
Here is solution for BDD framework written Ruby. Paste these two hooks in hooks.rb file
Starting the server:
AfterConfiguration do |config|
pid = spawn ‘appium --address 0.0.0.0 --port 4723’
Process.detach(pid)
sleep(10)
end
AfterConfiguration hook that will be run after Cucumber has been configured. This hook will run only once,after support has been loaded but before features are loaded. so it is usefull to launch Appium server.
Stoping the server:
at_exit do
exec ‘/usr/bin/killall -KILL node’
end
at_exit will be executed after execution of all the feature files. So executing exec '/usr/bin/killall -KILL node' command inside this hook kills the server at the end
call shell commands from inside of a Ruby program.
`/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js --address 127.0.0.1 --chromedriver-port 9516 --bootstrap-port 4725 --selendroid-port 8082 --no-reset --local-timezone`
change the path accordingly or copy the appium app to Applications folder
I'm following JMeter wiki page of CommittingChanges which was updated.
I'm running
ant checkstyle
ant package
ant test
Test Failed with error in differences from Bug52310.csv:
BUILD FAILED
C:\jmeter\jmeter\build.xml:2681: The following error occurred while executing th
is line:
C:\jmeter\jmeter\build.xml:2621: CSV Files are not identical.
C:\jmeter\jmeter\bin\testfiles\Bug52310.csv
ComputeIPAddr,200,OK,TG2 1-1,text,true
HTTP-Request-HC31,200,OK,TG2 1-1,text,true
HTTP-Request-HC4,200,OK,TG2 1-1,text,true
C:\jmeter\jmeter\bin\Bug52310.csv
ComputeIPAddr,200,OK,TG2 1-1,text,true
HTTP-Request-HC31,Non HTTP response code: java.net.SocketException,Non HTTP resp
onse message: Network is unreachable: connect,TG2 1-1,text,false
HTTP-Request-HC4,Non HTTP response code: java.net.SocketException,Non HTTP respo
nse message: Network is unreachable: connect,TG2 1-1,text,false
Total time: 3 minutes 9 seconds
Is it a bug or configuration/network issue? can all JMeter tests be execute in local environment?
EDIT
Also next step is to run different test
ant test-headless or ant test-headed (whichever was not run by the ant test)
Why not execute ant test-both in the first place?
when I execute ant test-headed and even and test-both it worked successfully
Regarding your first issue, it looks like a temporary connectivity issue from your machine or more probably that test computes an IP address for your machine that is not reachable .
This test exists to test ip-spoofing feature by setting the ip source to your machine address.
Run it in gui and see what IP is computed on your machine then try to resolve it.
Regarding ant test-both, yes it would be better, report a bug please.
Hi I am running my functional tests using geb.
I am able to run tests on my local computer correctly. but as I deploy my application to server. the build for functional tests fails.
Here is my console output
|Running 10 spock tests... 1 of 10
Failure: |
sign in with voucher
|
geb.driver.DriverCreationException: failed to create driver from callback 'script14007213321291157436758$_run_closure1#77068fce'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:346)
at geb.Configuration.getDriver(Configuration.groovy:335)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.go(Browser.groovy:377)
at geb.Page.to(Page.groovy:171)
at geb.Browser.via(Browser.groovy:454)
at geb.Browser.to(Browser.groovy:413)
at geb.Browser.to(Browser.groovy:391)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at VoucherSpec.sign in with voucher(VoucherSpec.groovy:14)
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/local/bin/firefox) on port 7056; process output follows:
Error: no display specified
Error: no display specified
Can anyone guide me to solve this issue.
The server you're running the tests on is 'headless' so doesn't have a display to start Firefox on to run the tests. You've got a couple of options:
Switch from Firefox to a headless browser such as HTMLUnit.
Configure a virtual display on the server.
Use a remote browser service such as SauceLabs.
If you need to test directly on Firefox then HTMLUnit isn't an option for you.
Using a remote browser service such as SauceLabs or BrowserStack has a couple of advantages, for example they record a video of the session and take screenshots, but we found the overhead of passing commands & traffic over the network made the tests unacceptably slow. If you need to test a wide variety of browsers then the overhead diminishes because you can run in parallel...
Option 2, using a virtual display, is the simplest to configure on most servers. If you're using Linux the X Virtual Frame Buffer (XVFB) will get you up and running quickly. It's worth reading up on what's going on but the short answer is:
Install XVFB (sudo apt-get install xvfb)
Install Firefox (sudo apt-get install firefox)
Start XVFB (sudo Xvfb :10 -ac -screen 0 1024x768x8 &). You may want to add an init script so this happens every time the server starts
In your CI server add export DISPLAY=:10 as a step before the tests are run
Run your tests
The XVFB creates a virtual display on :10, which you then set as the default display. When you start Firefox it's completely unaware that it's on a virtual display, so things like getting Geb to take screenshots of failing tests will work as normal.
For more information about the steps see:
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
https://github.com/tomaslin/grails-test-recipes
http://www.semicomplete.com/blog/geekery/xvfb-firefox.html
http://www.labelmedia.co.uk/blog/setting-up-selenium-server-on-a-headless-jenkins-ci-build-machine.html
http://manpages.ubuntu.com/manpages/lucid/man1/xvfb-run.1.html
If you need an init script to get it to start/stop, then there are quite a few to choose from, such as this one.
I'm following the sample Yeoman workflow listed on yeoman.io:
npm install -g generator-angular generator-karma # install generators
yo angular # scaffold out a AngularJS project
bower install angular-ui # install a dependency for your project from Bower
*grunt test # test your app
grunt server # preview your app
grunt # build the application for deployment
Everything works great except the grunt test command:
C:\yeoman2>grunt test
(logging omitted for brevity)
Running "connect:test" (connect) task
Starting connect web server on localhost:9000.
Running "karma:unit" (karma) task
Fatal error: listen EACCES
I haven't updated my gruntfile or made any other modifications to the configs. Has anyone seen this EACCESS error before? I'm on Windows 8, with a fresh node install.
This was happening because the karma server was running on port 8080. I changed it (in karma.conf.js) to 9999 and all is well.