How to configure appium on ubuntu operating system - android

Iam an automation tester having good experience in selenium automation tool and other tools.Now i want to implement mobile automation so i choose appium and started to install but faced number of issues and saw the same issues in several blog to rectify but couldnot.Kindly help me and below is the installation which i followed
1.Installed android sdk.
2.I just followed the instruction in the site http://appium.io/
brew install node # get node.js
npm install -g appium # get appium
npm install wd # get appium client
appium & # start appium
node your-appium-test.js
Now which brew gives me /home/user1/.linuxbrew/bin/brew ,
npm install -g appium but this gives me "Please try running this command again as root/Administrator."
Then i installed nvm then npm to solve this issue but again the same above error.I tried my best but i couldn’t.Can any one help pls.
Below are the configurations
Os:Ubuntu
Mobile Os:Android
Thanks a lot

This sounds like permissions issue with .npm folder in home directory that I faced also. Try following:
Make sure you installed node via homebrew (this will allow you to install Appium to a home directory without sudo). Do not install node via apt. Use brew list to check if node installed via brew.
Fix permissions issues with .npm folder (thanks for this answer): sudo chown -R $(whoami) ~/.npm
Install Appium with: npm install -g appium

Related

Appium. Cannot find module 'appium-base-driver'

My appium GUI was working perfectly fine until today. When I tried to start appium I am getting this error. I don't know how to get around it. So any suggestions / solutions highly appreciated.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' appium/build/lib/main.js --pre-launch --debug-log-spacing --automation-name "Appium" --platform-name "Android" --platform-version "6.0" --app "/Users/iamtheuser/fitbit/automation/artifacts/myapp.apk" --language "en" --locale "US"
Error: Cannot find module 'appium-base-driver'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (lib/main.js:7:58)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:146:18)
at node.js:404:3
Install Appium Doctor and investigate whats wrong in it.
Install Appium Doctor by below command:
npm install appium-doctor -g
Use Appium Doctor by below command:
appium-doctor -h
It seems you might :
updated appium version
might updated all other installed/removed gems/dependancies like nodeJS
Do you remember what activity have you done?
You can install the base driver by below command:
npm i appium-base-driver
You can install appium-base-driver by running following command from your command prompt
npm i appium-base-driver
If still the error is there then try installing it globally using below command
npm install -g appium-base-driver
If its not adding packages try with
npm install -g gulp
Try
Intall gulp with npm install -g gulp
The issue has happened because you might have updated java-client but not the appium server.
Say if your java-client version is 6.0.0-BETA4, you need to use Appium v1.7.2
Please update how you resolved this issue.
#Mysterio Man, hi . Could You please share what versions: java-client/appium GUI do You use ?
I'd recommend to try the following alternatives:
Install gulp using npm -g gulp
check for versions of appium GUI
check for java-client versions ; Maven repo
In my proj I'm using dependency
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.0.0</version>
</dependency>
Works fine for me.
And also installing appium i accurately followed this step-by-step setup instruction . Didnt face any issues.
In worst case- might be helpful to reinstall everything from scratch.
Let me know if You have resolved the issue.
Regards,
Eugene
Hey I also had the same issue,
check the node version you have
check if you have installed command line version of appium [there might be a chance of conflicts if both cli and gui are installed]
final option would be better uninstall node and appium & re-install both.
Cheers,
Have a great day
Please update your Appium version and try again
let's try the global installation again. please follow these steps:
move out of your project directory entirely to somewhere else on your system cd ~
uninstall appium npm uninstall -g appium
unset APPIUM_HOME export APPIUM_HOME=""
rm -rf ~/.appium
install appium npm install -g appium#next
confirm no drivers/plugins installed appium driver list (should show none installed)
install driver appium driver install uiautomator2
run appium appium
what happens when you do these steps?

"No command 'ionic' found" and "workon: command not found"

I have a weird problem in my Ubuntu 14.04.
I was developing a mobile application using Ionic with an API using Django-Rest-Framework. After developing, I downloaded jdk and Android SDK so that I can build the mobile app into APK. I also downloaded the android dependencies or tools needed for building. After I downloaded it all, I go to my mobile app folder and type ionic platform add android to build it. But the terminal response with "No command 'ionic' found". Even typing ionic serve responses the same. I also tried to activate the virtual environment of the API using workon mobile but it responses with workon: command not found. Does anybody have an idea what might be wrong? Thanks
First Check ionic is install or not by using following command
ionic -v
It shows version if it nothing to show then install ionic by using following command
sudo npm install -g ionic
else update ionic by the following command on your terminal
sudo npm update -g
And also if you have not got the result then create symbolic link by using following command
sudo ln -s /usr/bin/nodejs /usr/bin/node
Hope this will help you !!
First install using this two line..
npm install -g cordova ionic
ioniv -v && cordova -v
and then use this line
$ ionic start myapp [template]
$ cd MyIonic2Project/
$ ionic serve

Chromwebdriver problen when installing appium

I´m installing appium using these terminal commands:
sudo npm install -g appium
npm install wd
the installation process never ends and the error is :
Error trying to install Chromedriver binary. Waiting and trying again. fn must be a function
i tried to install Chromedriver manually but i still have the same problem, i also tried to do this on a vagrant machine and i still have the same issue and i don't know how to solve this,
if anyone has an answer it will be nice to share
thank you
Do not install nodejs through apt-get, which will need sudo rights and appium will not work if node is installed as sudo user. If you have already installed remove it using
sudo apt-get remove nodejs
sudo apt-get remove npm
Download latest nodejs linux binaries form http://nodejs.org/download/
Extract into a folder that doesn't need sudo rights to access, for example your home folder.
tar -xvf
Add the following line to your ~/.bashrc file.
export PATH=$PATH:<full_path_of_the_extracted_node_folder>/bin
Open a now terminal and do
npm install -g appium
appium

Appium Setup - no ./reset.sh file

I am attempting to set up Appium and am following the tutorial.
I get to the cd appium; ./reset.sh line in Install Ruby section. I don't have a reset.sh file anywhere. I've installed all prior steps, as well as XCode and Android Dev Studio.
So I tried to skip over that step, and simply run appium with node ., which throws error:
Error: Cannot find module '/Users/myname/Sites/myproject/appium
Obviously it needs a server.js or app.js file, but the git clone git://github.com/appium/appium.git repo clone did not come with one.
I'm not sure which other steps I should take to get Appium started. I simply want to get it running so I can start writing test functional test cases.
Follow these steps:
Install homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Uninstall home-brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Install node and npm:
brew install node
Install appium:
npm install -g appium
To start the appium server, run:
appium
HOW TO FIX ERROR: ENOENT LSTAT NPM WHEN TRYING TO INSTALL MODULES
npm cache clean
error: uncaughtException: fn must be a function
To fix this upgrade node or uninstall node and install node and appium again
brew uninstall node
brew upgrade node
and then install npm again
ios-webkit-debug-proxy installation and use, refer:
https://github.com/penguinho/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
https://github.com/google/ios-webkit-debug-proxy
https://github.com/jchuong/ios-webkit-debug-proxy
Install ios-webkit-debug-proxy only in iOS to enable appium to switch to web view context.
brew install ios-webkit-debug-proxy
NOTE: the proxy requires the "web inspector" to be turned on to allow a connection to be established. Turn it on by going to settings > safari > advanced > web inspector - On. Please be aware that the web inspector was added as part of iOS 6 and was not available previously.
brew install --HEAD ideviceinstaller

Titanium SDK will not recognize Titanium CLI, node, alloy, or npm on Ubuntu 12.04

Titanium SDK will not recognize Titanium CLI, node, alloy, or npm on Ubuntu 12.04
I followed the installation instructions for the Titanium SDK here: http://docs.appcelerator.com/titanium/latest/#!/guide/Quick_Start
Each time I try to launch titanium, it prompts me for some Titanium Updates.
But of course, when I click the fancy update button, it tells me:
'Installing Titanium Updates...' has encountered a problem. Error
encountered during update.
Cannot install Node on platforms other than Windows or Mac.
NPM is not installed.
NPM is not installed.
NPM is not installed.
I disagree: I have definitely installed node, npm, and I manually installed alloy with
npm install -g alloy
Here are some other relevant results from my terminal:
ryan#Grisbuntu:~$ which node
/home/ryan/local/bin/node
ryan#Grisbuntu:~$ which titanium
/home/ryan/local/bin/titanium
ryan#Grisbuntu:~/local/bin$ titanium -v
3.1.2
ryan#Grisbuntu:~/local/bin$ node -v
v0.10.15
ryan#Grisbuntu:~/local/bin$ alloy -v
1.2.2
ryan#Grisbuntu:~/local/bin$ npm -v
1.3.5
I'd like to continue with a "Hello World" application (and beyond), but for example when I click "Run->Android Emulator", I get the following error:
'Launching Titanium Android Emulator - html5-hello' has encountered a
problem.
Unable to locate the CLI executable. Please restart Studio or use
Help > Check for Titanium Updates to install Titanium CLI.
I have discovered quite a few similar questions out there, but few answers... can anyone give me a clue as to how to fix this? I am new to Titanium/Eclipse: Is there a simple path setting that I am missing somewhere?
I think I fixed my own problem. Despite the fact that node and npm were previously installed on my system, and I was able to do things like "node -v" and "titanium -v" from a "normal" linux terminal, Titanium was not recognizing the existence of any of these programs. I tried various combinations of inserting an export statement into my bash profile, uninstalling and reinstalling node, (via apt-get and manually extracting the tarball, etc) and so on, but nothing seemed to work.
What I ended up doing was launching my Titanium project, and I ran "node -v". It gave me version 0.6.blah.blah. I am still confused why this is... but to solve it, using the terminal WITHIN titanium, I issued all the following commands:
(before I go on, if you're going to try this yourself, this answer might be incomplete or slightly inaccurate: i'm sorry that I didn't write it down exactly as i went... but this is close. The point to this solution is that I had to do it FROM WITHIN titanium).
sudo apt-get remove npm
sudo apt-get remove node
wget http://nodejs.org/dist/v0.10.18/node-v0.10.18.tar.gz
tar -zxf node-v0.10.18.tar.gz
cd node-v0.10.18
./configure && make && sudo make install
RESTART TITANIUM
then, again in a titanium terminal, run
npm install titanium
npm install alloy
Those last 2 commands are what really got me over the hump. My hello world application, and my android emulator, now successfully launch. Hope that helps someone. If anyone can explain to me why I had to do it this way, I'd like to understand it. Otherwise, thanks & good luck!

Categories

Resources