Friday, 19 September 2014

How to check whether css selector is correct or not in Chrome selenium inspect elements

How to check whether css selector is correct or not in Chrome selenium inspect elements


Open Chrome browser
Right Click on any element click Inspect elements as a result you will get development tool

Select Console Tool there


And after that


$$(" here give your css selector path ")

for xpath we can check like this
$x('//*[@id="header-container"]')

And click enter path should select .

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 which is a maven repository 

Via Find Folder on your mac 

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

To navigate to your .m2 folder in your mac terminal  


firstname.lastname@MRMAcNAME ~ %  cd ~/.m2

Now you are on .m2 folder to list all your files under .m2 use ls command


==========================================================

firstname.lastname@MRMAcNAME .m2 % ls

settings.xml settings.xml-20231012212836 settings.xml-20240403202322
repository

==========================================================
To navigate to particular file
firstname.lastname@MRMAcNAME .m2 % cd repository/monetdb/monetdb-jdbc/2.29/


==========================================================
Just in case if you want to delete your repository folder very quickly and easily use the below command 

firstname.lastname@MRMAcNAME .m2 % rm -rf repository

chrome driver download for mac laptop selenium cucumber bdd

Chrome driver download on mac