Tuesday 29 July 2014

Guice provision errors on mac selenium cucumber automation java

Guice provision errors on mac

This problem occurs due to technical path errors
In my case I have given wrong path for chrome as below.. thats why its came.. After correcting path.. it resolved.

I have given this path as per windows .. thats why this path is not working on mac ... hence the below error occuring..

/Users/usreid/Desktop/automationframework/\\Applications\\Google Chrome.exe] 

After that I have change my path as per mac the it started working fine.

Click here how-to-setup-chrome-driver path -on-mac


Failure in after hook:RegistrationHooks.signOut()

Message: com.google.inject.ProvisionException: Guice provision errors:
1) Error in custom provider, org.openqa.selenium.WebDriverException: The chrome binary [/Users/usreid/Desktop/automationframework/\\Applications\\Google Chrome.exe] does not exist.

Build info: version: '2.37.0', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-18 09:51:02'

System info: host: 'localhost', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.2', java.version: '1.6.0_65'

Driver info: driver.version: unknown

  while locating com.comapanyname.selenium.WebDriverProvider

  at com.comapanyname
.configuration.guice.WebDriverModule.configure(WebDriverModule.java:15)

  while locating org.openqa.selenium.WebDriver

    for parameter 1 at com.comapanyname.selenium.DocumentAccessor.<init>(DocumentAccessor.java:31)

How to setup chrome driver on mac selenium bdd cucumber automation

How to setup chromedriver path on mac laptop to selenium cucumber automation scripts.

1) First download chrome driver from the following path

2)  From your mac search for "AppleScript Editor"
AppleScript Editor will open editor please paste the below code and click run
do shell script "/Applications/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/Users/$USER/Library/Application\\ Support/ChromiumPersonal > /dev/null 2>&1 &
Popup window will come and ask you to enter untittled name
enter "Chrome" Save it on Applications location.
3)Open chrome browser which is already installed on your mac and type below link on browser url
//Applications//Google Chrome.app//Contents//MacOS//Google Chrome
It will download chrome ... let it download
Then go to your Selenium or cucumber java code give this path as chrome driver path 
'//Applications//Google Chrome.app//Contents//MacOS//Google Chrome'
Now it should work . Note in MAC there is no .exe just like in windows system.Here we use above path.

If you feel it is useful please share on facebook and please like on facebook icon.


mvn command is not found on mac

Some times you might already fixed environment variables but after session out.. it will disappear.. in that case you have to do like this.
 Here I explained how to setup environment variable for Maven, Java

Since your installation works on the terminal you installed, all the exports you did, work on the current bash and its child process. but is not spawned to new terminals.
env variables are lost if the session is closed; using .bash_profile, you can make it available in all sessions, since when a bash session starts, it 'runs' its .bashrc and .bash_profile
Now follow these steps and see if it helps:
  1. type env | grep M2_HOME on the terminal that is working. This should give something like
    M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1

  2. typing env | grep JAVA_HOME should give like this:
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
Now you have the PATH for M2_HOME and JAVA_HOME.
If you just do ls /usr/local/apache-maven/apache-maven-3.1.1/bin, you will see mvn binary there. 
All you have to do now is to point to this location everytime using PATH. Since bash searches in all the directory path mentioned in PATH, it will find mvn.
  1. now open .bash_profile on Terminal  if you don't have one just create bash_profile
    vi ~/.bash_profile
Add the following:
#set JAVA_HOME
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
export JAVA_HOME
M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2_HOME
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
export PATH
After this click on esc button and : and wq so that your file will save.
Now type
source ~/.bash_profile   click enter
This steps executes the commands in the .bash_profile file and you are good to go now. 
Now type mvn --version 

what is the best FTP for mac

FTP for Mac
You can download cyberduck from this location.
http://cyberduck.en.softonic.com/mac

Where is .m2 folder maven repository on mac

Where is .m2 folder maven repository on mac

If you search directly it won't appear so please follow as below steps to see .M2 repository path.
Go-> Find folder ->  type this ~/.m2 and click go
"~/.m2 "

chrome driver download for mac laptop selenium cucumber bdd

Chrome driver download on mac 

How to generate keygen on mac

How to generate keygen on mac 
Here you can see all the details to setup git on your mac laptop
http://guides.beanstalkapp.com/version-control/git-on-mac.html

how to mention chrome driver path on mac for selenium bdd cucumber java

For Mac chrome driver resides in this path. Here in mac chrome path extentions is .app 

//Applications//Google Chrome.app//Contents//MacOS//Google Chrome

If your chrome driver is not working properly then 
Open this path on your browser so that automatically downloads chrome browser in required path.

Monday 28 July 2014

vi or vim editor commands help

vi or vim editor commands help

http://www.cyberciti.biz/faq/save-file-in-vi-vim-linux-apple-macos-unix-bsd/

how to setup maven on Mac

Maven setup on Mac laptop

1) Being as a first point you have to download maven
Download from this link
http://maven.apache.org/download.cgi

2) Create folders on your mac
Click Go->Go to folder /usr/local
right click create new folder “apache-maven”
open this folder and again create sub folder
folder name “apache-maven-3.2.2” Hint- based up on your maven version you can put folder name

3)Then open Terminal command prompt .
localhost:~ userid$ cd /usr/local
localhost:local userid$ ls
apache-maven git libexec
localhost:local userid$ cd apache-maven
localhost:apache-maven userid$ ls
apache-maven-3.2.2
localhost:apache-maven userid$ cd apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ M2=$M2_HOME/bin
localhost:apache-maven-3.2.2 userid$ export PATH=$M2:$PATH
localhost:apache-maven-3.2.2 userid$ echo $JAVA_HOME
/Library/Java/Home
localhost:apache-maven-3.2.2 userid$ mvn --version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T14:51:42+01:00)
Maven home: /usr/local/apache-maven/apache-maven-3.2.2
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"

localhost:apache-maven-3.2.2 userid$ whereis mvn

To find path where is maven use this command
localhost:apache-maven-3.2.2 userid$mvn -version

Now your maven setup done.






More detailed Help details :

http://maven.apache.org/download.cgi
As per above link you can get details as below.

details available on bottom of the page. 
Extract the distribution archive, i.e. apache-maven-3.2.2-bin.tar.gz to the directory you wish to install Maven 3.2.2.
 These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.2.2 will
 be created from the archive.

In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2.

Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.

Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m".
 This environment variable can be used to supply extra options to Maven.

Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH.

Make sure that JAVA_HOME is set to the location of your JDK, e.g.
 export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in your PATH environment variable.

Run mvn --version to verify that it is correctly installed.

how to setup up JAVA_HOME environment variable on mac

How to setup up JAVA_HOME environment variable on mac laptop

Being as a first point
Open Terminal from your mac this is command prompt on mac laptop.
Now type echo $JAVA_HOME it should return java details if it is already installed.
So that you will come to know. whether it is existed or not.

In Mac laptop all environment variables will setup in bash_profile

So if you are first time setting up in the scene it might not exist. So to let you know whether it is existed or not Type below command  on Terminal command prompt.

ls -1 ~/.bash_profile

If it is not existed then it will say “No such file or directory”

Now type this command
touch ~/.bash_profile

Now open file in vim editor this is editor in unix.
vim ~/.bash_profile
it will open some text editor.
If you try to type any thing on this.. it wont allow.. if you want to insert any thing please press
esc + i   it allow to enter data into vim editor

Now enter these lines on that editor

export JAVA_HOME=/Library/Java/Home
export JRE_HOME=/Library/Java/Home

Now you have to save and exit from the editor to do that please press escape : colon then wq
6. esc + :wq
To execute that file please enter this command.
7. source ~/.bash_profile
To check java details please enter this command
8. echo $JAVA_HOME
9.echo $JRE_HOME

Any how please have some help on this video
JAVA_HOME environment setup help video on mac



To make sure those environment variables work in all sessions.
We have to do as below.

type env | grep M2_HOME on the terminal that is working. This should give something like
M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1

typing env | grep JAVA_HOME should give like this:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
Now you have the PATH for M2_HOME and JAVA_HOME.


now open .bash_profile on Terminal  if you don't have one just create bash_profile
vi ~/.bash_profile
Add the following:

#set JAVA_HOME

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home

export JAVA_HOME

M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1

export M2_HOME

PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin

export PATH

After this click on esc button and : and wq so that your file will save.

Now type

source ~/.bash_profile   click enter

This steps executes the commands in the .bash_profile file and you are good to go now.

Now type mvn --version

How to install java on mac

How to install java on mac laptop
Installation steps you can get here
https://www.java.com/en/download/help/mac_install.xml

Java installation on mac help video

How to setup eclipse on mac

How to setup eclipse on mac laptop.

http://www.cs.dartmouth.edu/~cs5/install/eclipse-osx/