среда, 26 февраля 2014 г.

Java and Maven clean set up

Java installation 

Here is a great guide with screenshots how to install Java: http://www.wikihow.com/Install-Java After all steps from the above link are done:
1. Go to Control Panel > System > “Edit the system environment variables” or press Win+Pause and select “Advanced system settings”, edit Path variable: ensure that it contains path to “path_where_java_installed/bin” folder

2. Then open CMD (if it is opened, you should close and reopen CMD)(Start > Run> “cmd”), type “java”, hit enter, you should see Java usage options.

That’s it. Java is installed. 

Maven installation

Download Maven from http://maven.apache.org/download.cgi?Preferred=ftp://mirror.reverse.net/pub/apache/ . For example ftp://mirror.reverse.net/pub/apache/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
1. Export apache-maven-3.2.1-bin.tar somewhere
2. Update Path system variable with the path where tar was exported, eg:
   C:\Maven\apache-maven-
3.2.1\bin
3. Add new system variable JAVA_HOME with value to your jdk installation, eg:
   C:\Program Files\Java\jdk1.7.0_03


Maven is ready.

Firefox Profile creation

How to create Firefox profile for your Selenium?

To create your FF profile: at first you should create a folder, where your profile will be created. Create this folder somewhere on your computer. For example folder with name “FFAutomation”. After that close all FF instances, open cmd and execute “start firefox.exe -ProfileManager”. Uncheck “Dont ask at startup”, click Create new profile, select a folder that you’ve created, enter the name of the Profile (FFAutomation) and then start firefox using this profile. Set up your profile as follows:

  1. Click “Tools\Options” then set the following:
  2. a. “Main” tab
  3. - set Home Page to “about:blank”
  4. - uncheck “Show the Downloads..” option
  5. b. “Tabs” tab
  6. - Select “a new window” for new pages (in other words, uncheck “Open new windows in a new tab instead”)
  7. - Uncheck all warning options
  8. c. “Content” tab
  9. - uncheck “Block pop-up” windows option
  10. d. “Privacy” tab
  11. - leave it as “Remember history”
  12. e. “Security” tab
  13. - uncheck all “Security” options
  14. - click “Settings” and uncheck all warning options
  15. f. “Advanced” tab
  16. - Uncheck “autoscrolling” option from “General” tab
  17. - Uncheck “use hardware accelleration..” option
  18. - uncheck “warn me …” and “Search Engines”option from “Update” tab
  19. Browse to the desired BPM instance. Add an exception for the invalid certificate, and make sure “Permanently store this exception” is checked.
  20. - In the “Update” tab uncheck all automatic update options

After your Profile is set up,  close Firefox, then open again, select your Profile

Python, Java and Selenium RC clean set up


What should be installed first?

You have to install:
1. Python 2.7.x - this is to run automated tests
2. Java - this is to run selenium server

Python installation 

1. Download and Install python 2.7.x to C:/Python27
2. Set up environment variables:
    a) Control Panel > System > “Edit the system environment variables” or press Win+Pause and select “Advanced system settings”
    b) Press Environment variables
    c) Add new System varaiable named PYTHONPATH. For the value, put the path where Python is installed (e.g. “C:\Python”) Hit OK. Edit the “Path” variable. Add a “;” followed by the path where Python is installed (e.g. “C:\Python”) and hit OK. Press OK in the Environment variables window.
    d) Your python should become configured now. Open CMD (Start > Run> “cmd”), type “python”, hit enter, you should see Python start: Now you can either quit python (hit ctrl+C ot ctrl+Break) or close cmd. Python is installed.

Java installation 

Here is a great guide with screenshots how to install Java: http://www.wikihow.com/Install-Java After all steps from the above link are done:
1. Go to Control Panel > System > “Edit the system environment variables” or press Win+Pause and select “Advanced system settings”, edit Path variable: ensure that it contains path to “path_where_java_installed/bin” folder

2. Then open CMD (if it is opened, you should close and reopen CMD)(Start > Run> “cmd”), type “java”, hit enter, you should see Java usage options.

That’s it. Java is installed. 

Running selenium server. 

1. Go to http://docs.seleniumhq.org/download/ and download latest Selenium Server, eg http://selenium-release.storage.googleapis.com/2.40/selenium-server-standalone-2.40.0.jar  
2. Open cmd, cd to the folder with selenium server and execute 'start java -jar selenium-server-standalone-2.40.0.jar'
3. You will see new window with selenium server started. By default it starts on 4444 port, but you can say exact port to selenium server with command -port, eg
'start java -jar selenium-server-standalone-2.40.0.jar -port 8808'

That's it. Selenium server is running. You can stop it by just closing the window of Selenium server.