Wednesday, December 3, 2014

Firefox ESR for Selenium


Firefox ESR For Selenium

Firefox

One thing to note for Selenium is it is sometimes behind Firefox releases. So I recommend installing the Firefox Extended Support Release. To download this go to : https://www.mozilla.org/en-US/firefox/organizations/

After downloading the installer, you will have to extract it

sudo tar -xvjf firefox-*.*.*esr.tar.bz2 -C /opt

Next is to back up your existing Firefox

sudo mv /usr/bin/firefox /usr/bin/firefox-old

Next is to link the new Firefox ESR

sudo ln -s /opt/firefox/firefox /usr/bin/firefox 
For the first time you run, execute
gksudo firefox


Tuesday, September 9, 2014

PHP Tools

PHP tools

So now we now a linux mint virtual machine with php. So we can start coding in php. But it is not easy to code in vi. So I have searched on what will be a nice IDE for PHP. Can I recoment SublimeText. As of writing SublimeText 3 is currently in beta testing. But I find it stable enough to use.



So for this post, let me run through the installation of SublimeText3 and a couple of nice plugins for it.

SublimeText3



Go to SublimeText3 download page and click on the Ubuntu 64 bit link. A pop up will appear and click on save file. Once it is done, double click on the downloaded deb file. The package installer window.



Click on the Close button and then the Install Package button. This will then ask you to just enter your password again. This will then start the installation.Click on close after the installation. You can now close the package installer. You can now find SublimeText3 under Programming Menu






Now open up SublimeText3 and we can start installing some plugins.


Plugins



First off, we need to install Package Control . Package Control is your easy way to install and update SublimeText packages. There are tons of packages that you can install for SublimeText that does different things.



You can go to Installation page. In this page, you can find the command that will be used to install Package Control. You will have to copy the the SublimeText 3 version of the command.

Now go back to SublimeText3 and click View -> Show Console. And then paste the copied text to the console.



Now its time to download more plugins.



First off, may I suggest SublimeCodeIntel. This will help in in code completion and function look up. I find it a bit flaky at times, but when it works, it works like a charm.

To install click on Preferences - Package Control. Type Install Package. Then type SublimeCodeIntel. After installation, you should restart SublimeText3. I highly recommend updating the user settings. To do so click on Preferences -> Package Settings -> SublimeCodeIntel -> Settings - User.




This will open up a blank file. In this file, paste this :


 {"PHP": {
            "phpExtraPaths": [],
            "codeintel_scan_files_in_project": true,
            "codeintel_max_recursive_dir_depth": 5
        }
 }



Next up is a syntax checker. This will be a couple of steps process. First among the packages that we need to install for syntax checking is SublimeLinter.  To install, go to Preferences -> Package Control. Type Install Package. Type in SublimeLinter and select SublimeLinter. This will install the package. I again recommend to restart SublimeText3 after the installation.



SublimeLinter won't work as is, it needs the linter package for our development tool of choice. For me I installed SublimeLinter-php. To install, go to Preferences -> Package Control. Type Install Package. Type in SublimeLinter-php and select it. I may sound like a broken record at this point, but, restart SublimeText3.



Some of the important shortcuts to remember are :

ctrl+k, l :  Lint the current view.
ctrl+k, n : Go to the next error.
ctrl+k, p : Go to previous error
ctrl+k, a :  Show all errors.


Now we are ready to go to Selenium.

Thursday, August 28, 2014

Learning PHP

Problem

I have recently taken a new post as Lead QA Automation Engineer. The environment that the developers are writing code is in PHP. So I decided to also use PHP for automation. In this case I can easily get help from the developers. Problem is, I have no experience with php. So I have to start learning.

So first step for me was to set up an environment. First off, I want to give credit to where credit is due. I want to credit Juan Treminio's blog for getting me started. His blog is Setting Up a Debian VM, Step by Step. But I want to update this a little bit as I wanted to use Linux Mint in this experiment.

What you need

For this tutorial, I will be using Oracle Virtual Box. This makes it really easy and inexpensive if you make mistakes. You can also use other virtualization technology out there. I am just more familiar with this one.

Next, you will need a ISO from the Linux Mint website. I suggest you get the latest version. There are several types of iso that you can download. For the sake of this tutorial, I will be using the cinnamon installation image.

Lets Start The Install

So that I don't repeat Juan's blog, just follow his steps on setting up the virtual machine and mounting the iso. After you start your vm the first time, come back here.

  • You will be in the Mint Desktop. You will have to click the "Install Linux Mint" icon on the desktop.


  • Next steps you will be choosing your Language and click Continue.
  • Then the installation will check the system requirements. Just click Continue.
  • Next will be the installation type.  Just choose the default option and click Install Now.
  •  
  • You will choose your timezone and click Continue. Next will be you keyboard layout and click Continue.
  • Next will be to enter your identity.  Your name, computer name, username and password. And click on Continue.
  • This will start the installation of Linux Mint. Go and grab something to eat or drink.
  • After the installation, you will be asked to restart. Just click on the Restart Now.
  • After the VM restarts, you will have to enter your password.
  • At this point it will be a good idea to just run the update.  Click on the shield by the clock on the lower right hand side. Then click on the install updates.

  • Click on Devices and Insert Guest Additions CD image...Then click Run
  
 
Congratulations. Your OS is installed and up to date.

Install services

First off, open up a terminal window. Install some mySql

sudo apt-get install mysql-server mysql-client

Answer Y to any prompts that you will get asked during installations.It will ask you to enter a root password.

Next Install Apache and PHP. You will run the following :

sudo apt-get install apache2 openssl
sudo apt-get install php-pear php5 php5-cli php5-common php5-curl php5-dev php5-intl php5-json php5-mcrypt php5-mysql php5-xcache php5-xdebug libpcre3 libpcre3-dev curl 

You will need to install oauth extension from pecl

sudo pecl install oauth


You need to edit both /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini and add the line to the extension section.

extension=oauth.so

Next stop is to install composer.

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer 

Now you have the basic stuff that you need to run php. With your favorite text editor in linux, create a new file and call it version.php. put in that file . Then in a terminal window run php version.php. Your console should now print information about your php.




Congratulations! You are done setting up the basics. Watch out for the next one.