Start Appium Server on bat file with version 1.6.4 - batch-file

With the previous version of Appium, I could start an appium server through command line in batch like this.
START node.exe node_modules\appium\bin\appium.js --port 4723
But now since the new release 1.0.0 (or 1.6.4) depends on how you calling it, There no node.exe anymore or appium.js either.
Can someone tell me where can I find these file ? or the "new" way of doing it ?
Thanks a lot !

With Appium 1.6.4, there are 2 ways of installing/using it -
We can do it the old fashioned way with Node. Installation happens via node with command - npm install -g appium. Then you can run it the same way you mentioned in your post.
If we install it via Appium Desktop (v1.0.0), then we don't need Node and the server can be started using the Appium Desktop UI.
I have also used appium -a 127.0.0.1 -p 4723 in command prompt and it works fine. And if you want to look at Java code to start appium, you can check this out as well - Start Appium server with Java

You can use main.js in place of appium.js to start the appium, it is the change we need to incorporate from Appium 1.6.4

Related

Invalid or corrupt jar file when trying to start selenium server from intelliJ

I am trying to start my selenium server from intelliJ and it is saying the file is corrupt.
I use intelliJ to run my protractor tests, and when I starts the selenium server from the intelliJ terminal before I run them. For whatever reason it is saying my jar file for selenium-server-standalone is coming back as corrupt. Is there a way to fix this and, if not, is there a way to delete and then reinstall selenium server?
C:\Users\pheonix.jones\IdeaProjects\attensity-q-protractor>webdriver-manager
start [11:39:09] I/start - java
-Dwebdriver.chrome.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.46.exe
-Dwebdriver.gecko.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\pro
tractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe
-jar C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar
-port 4444 [11:39:09] I/start - seleniumProcess.pid: 2748 Error: Invalid or corrupt jarfile
C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar
[11:39:09] I/start - Selenium Standalone has exited with code 1
As you can see, it is just exiting after it comes back as corrupt. I haven't had issues with this before. I did try to update the webdriver.
I found a workaround, which may or may not be acceptable. You can force webdriver-manager to use an older version of the selenium-standalone package. This avoids whatever the problem is with 4.0.0-alpha-1.
$ webdriver-manager clean
$ webdriver-manager update --standalone --versions.standalone=3.8.0
$ webdriver-manager start --versions.standalone=3.8.0
…
[14:19:55] I/start - seleniumProcess.pid: 63863
14:19:55.379 INFO - Selenium build info: version: '3.8.0', revision: '924c4067df'
14:19:55.380 INFO - Launching a standalone Selenium Server
2019-04-24 14:19:55.483:INFO::main: Logging initialized #390ms to org.seleniumhq.jetty9.util.log.StdErrLog
There is an open defect in the webdriver-manager project for this issue: https://github.com/angular/webdriver-manager/issues/370
As a temporary workaround you can use the directConnect attribute in your protractor config.
There is issue with 4.0.0-alpha-1 , after deleting files you can install some older versions that will work. If you will just update wevdriver manager by using webdriver-manager update then it will not work for you but you need to use something like " webdriver-manager update --standalone --versions.standalone="some older version"
Since you are using Protractor, you can try a webdriver-manager update
You should be starting the server like this - webdriver-manager start
I believe Protractor's webdriver-manager already contains the selenium standalone server.
Or you can just add this line in your conf file, and you will no longer need to manually start anything before running a Protractor spec file directConnect: true

Unable to start webdriver-manager on mac to test angular apps on protractor

I am new to protractor. While starting the Selenium Server using webdriver-manager in protractor I am getting the following error
[19:32:29] I/start - java Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.31 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar -port 4444
[19:32:29] I/start - seleniumProcess.pid: 823 Error: Unable to access jarfile /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar
[19:32:29] I/start - Selenium Standalone has exited with code 1
AgIwals-MacBook-Pro:angulartestingprotractor agiwal$ Error: Unable to access jarfile /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar
My protractor version is 5.1.2 and my npm version is 3.10.10. Can somebody help me with this error?
Looks like you need to update webdriver-manager - a new version was released yesterday so your timing is coincidental. You can also see the language bindings release dates here: http://docs.seleniumhq.org/download/. And since you mentioned you're on Protractor v5+, you should also confirm that your node (not npm) version is v6+.
You simply need to run webdriver-manager update -- personally I like to avoid potential driver/version conflicts by cleaning out any old downloads via webdriver-manager clean, but that's up to you (run the update after clean).

ckan local installation, 500 error on solr JSP support not configured

I am trying to install CKAN on my local computer using Ubuntu 14.04 LTS.
I followed the instructions for installing from source found here and I try to check if solr is running by visiting http://localhost:8983/solr/.
I can see that Jetty is running because when I visit http://localhost:8983 I see that it is up.
I added the jdk as follows:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
I am getting a 500 error when i try to open the solr page:
HTTP ERROR 500
Problem accessing /solr/index.jsp. Reason:
JSP support not configured
Powered by Jetty://
Any ideas? Should I redo the whole thing from the start?
Edit/Update
I just couldn't do anything with this installation. The bigger problem was that installation files were meshed up! I tried to install tomcat/solr instead of jetty/solr and things went sour. So I just created a VM and did a fresh install there. For anyone interested I did a tomcat/solr installation following this and a CKAN installation following this (with out of course the solr instructions). Also, for some reason the CKAN installation has commented out the solr URL, so even if it is right, I had to delete the comment.
A fix has been documented by #mstantoncook here [2939] & [1651] How to solr-jetty JSP support
Note the last comment, sudo service jetty restart
It's a Jetty BUG on Ubuntu 14.04!
There is nothing wrong with Ckan itself.
Actually, there is a bug in the libjetty-extra-java package (version 6.1.26 and newer) in Ubuntu 14.04. The bug was introduced after Jetty (in Ubuntu) has changed it's dependences from libtomcat6-java to libtomcat7-java.
You can get more info about this bug in Ubuntu Launchpad: Bug #1508562 "Broken symlinks for JSP support in libjetty-extra-java version 6.1.26-1ubuntu1.1".
The bug is already fixed on Debian, and I'm hope it will be solved in Ubuntu 14.04 soon.
There are workarounds that may work for your case
I proposed some workarounds in this bug report, and since they can be useful for the Ckan users, I'll also replicate them here.
All of them consist on use both jetty and libtomcat7-java, but adding/replacing some classes (code ported from libtomcat6, in put in the jsp-2.1-6.0.2.jar file) to the Jetty classpath.
I don't know if they have some problem. Use them at your own risk!
Workaround 1 - Install the fix package proposed by vshn
I found this workaround here: https://github.com/ckan/ckan/pull/2966
In short:
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
service jetty restart
This will install a JSP jar that works (the file will be named jsp-2.1-6.0.2.jar, but it contains classes ported from libtomcat6).
Workaround 2 - Manually install the JSP jar
Download the same JAR file that the DEB package above would install.
wget https://bugs.launchpad.net/ubuntu/+source/jetty/+bug/1508562/+attachment/4785985/+files/jsp-2.1-6.0.2.jar
Now, move it to a proper location inside the Jetty config dir. I did it this way:
mkdir /etc/jetty/extra-jars
mv jsp-2.1-6.0.2.jar /etc/jetty/extra-jars
And add a line like this one in the Jetty start.config file:
echo "/etc/jetty/extra-jars/jsp-2.1-6.0.2.jar" >> /etc/jetty/start.config
And:
service jetty restart
Correct solution
The correct solution is to wait for the Ubuntu Team solution. However, while waiting for this fix, you can use any of the previous workarounds (I prefer the last one).
I hope they help you!
Try this steps:
sudo mv jsp-2.1-6.0.2.jar /usr/share/jetty/lib/.
change own:
sudo chown root:root /usr/share/jetty/lib/jsp-2.1-6.0.2.jar
finally restart jetty:
sudo service jetty restart
I followed this steps and now I can see localhost:8983/solr and localhost/solr/admin
In Ubuntu 14.04 this can be fixed with:
cd /tmp
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
sudo dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
sudo service jetty restart
Following http://docs.ckan.org/en/ckan-1.6/solr-setup.html#single-solr-instance
(this one a bit old, but worked perfect for me )
You will have to edit /etc/profile and add this line to the end such as this to the end (adjusting the path for your machine’s jdk install:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/ (or other version)
then
export JAVA_HOME
sudo service jetty start

AnglularJS: Can Protractor run on Windows?

The angular doc recommends Protractor for e2etesting.
http://docs.angularjs.org/guide/dev_guide.e2e-testing
I didn't find any doc about running it on Windows.
Can Protractor run on Windows?
**
Update:
I have some experience on Selenium using C# code to call functions in some selenium dlls to control IE brower.
But what are the relationship between Protractor, Selenium and NodeJS?
Is Protractor an tool(exe) or a lib(dll) or a JS lib(like Jasmine)?
Yes, you can run it on windows.
I hope this guide will help you:
http://www.ng-newsletter.com/posts/practical-protractor.html
You should Start Selenium local server and use this basic configuration for run protractor (Depending routes):
chromeDriver: './node_modules/protractor/selenium/chromedriver',
specs: ['test/e2e/**/*_spec.js'],
chromeOnly: true,
chromeDriver: './node_modules/protractor/selenium/chromedriver',
seleniumAddress: 'http://0.0.0.0:4444/wd/hub'
Yes at least it should. It runs on node and node runs on windows. However sometimes projects have windows issues, the most common cause IMO is hardcoding of / etc.. If the library uses node path and similar os independent apis then all is fine.
I have ran protractor on windows without any issues. But not extensively.
Prerequisites & Installation:
Prerequisites
Node.js (Latest Version)
Download NodeJS
Install NodeJs
To test Node.Js installation properly open command prompt and execute the command.
Java Development Kit(JDK)
Download the JDK
Install JDK from
Installation
Install Protractor Globally
Open the command prompt and type following command to install protractor globally.
npm install -g protractor
This will install two command line tools, protractor and webdriver-manager. Try running below command to check protractor version.
protractor –version
The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running. Use it to download the necessary binaries with:
webdriver-manager update
Now start up a server with:
webdriver-manager start

Unable to use mvn gae:run with version maven-gae-plugin:0.9.4?

I am using maven gae plugin version 0.9.4 and whenever I use mvn gae:run I get the following error:
Usage: <dev-appserver> [options] <war directory>
Options:
--help, -h Show this help message and exit.
--server=SERVER The server to use to determine the latest
-s SERVER SDK version.
--address=ADDRESS The address of the interface on the local machine
-a ADDRESS to bind to (or 0.0.0.0 for all interfaces).
--port=PORT The port number to bind to on the local machine.
-p PORT
--sdk_root=root Overrides where the SDK is located.
--disable_update_check Disable the check for newer SDK versions.
--generated_dir=dir Set the directory where generated files are created.
Googling this turned up some old threads where this used to be a problem in 0.5 versions of the plugin but was fixed. Not sure why its happening for me and what are the work arrounds. Any ideas?
I also experienced this problem with maven-gae-plugin 0.9.4 and jdk1.6.0_23 on Windows 7. All I did to reproduce this was to create a project using the gae-archetype-jsp archetype and then use mvn gae:run.
However, I backed maven-gae-plugin down to 0.9.2 and the problem went away!

Resources