Sunday, March 27, 2016

Selenium Builder (Se-builder) - For rapid creation of test cases.


There are quite a few good automation tools out there which allow record and play tests efficiently. While Selenium IDE, TestComplete, UTF are few of the popular options, I stumbled upon a neat tool: SeleniumBuilder (AKA Se-Builder).

Se-Builder installs as an Firefox Addon, which is similar to how Selenium IDE is installed, and is launched from the context menu.



When launched, the interface appears in a pop-up windows which contains three options: Open Script or Suite, Manage Plugins and Start Recording tests. The recording option provides simple and convenient interface to record the test steps (user actions). The similarity of Se-Builder and Selenium IDE ends when it comes to the way Se-Builder stores and exports the scripts. Se-Builder stores the recorded steps in JSON format and it also comes with its own JSON interpreter. By storing in JSON format the scripts can be exported to Python, Java and JS code, which according to the documentation, was the main intention of storing the steps in JSON. One interesting use case would be to record the steps using the Se-Builder IDE and then playback directly using the provided Interpreter (using the interpreter as a Java Library).


                                         

The export functionality is one of the main strong points of using this tool. One glance at the options provided under export menu tells you why. The one that was surprising was the export to Node.JS supported tools. This means we can record the scripts and then export the scripts to   Jasmine format that can be understood by Protractor and deploy them in a BDD environment. It also supports exporting to JUnit, TestNG, Ruby, Python, PHPUnit among the others.


Like every tool , there are some cons with this one as well. For Example: when exported to Protractor format, some of the steps such as waiting/checking for the element to appear do not get exported to proper JS script command, instead comment Pseudocode is present for the test developer to implement. Most of the elements are accessed by xpaths, which can result in expensive in execution time, elaborate and tedious to maintain.

In conclusion, if you want a tool to script or accumulate automated tests in a short time, consider Se-Builder to get you 80% through the effort of writing the steps. It would be easy to develop page objects and add them to the exported scripts to build a robust test suite.

Links:
  • Se-Builder: http://seleniumbuilder.github.io/se-builder/
  • Jasmine: http://jasmine.github.io/
  • Protractor: https://angular.github.io/protractor/#/

Sunday, May 24, 2015

about Resilient testing

With the wide spread adoption for Agile development methodologies and continuous integration features a recondite form of testing called a Resilience testing in coming into focus. If you have not heard of Resilient testing, then its better late than never to learn about it.

Resilience is a non-functional form of testing which evaluates as to how well a product can deliver when one of many of its components fail. Irrespective of the type of coupling (Cohesion) between modules of a product or between interdependent services, the resilience testing is always relevant because, for example, continuous integration of modules can bring about failure in the system if the necessary scenarios are not covered during testing.

Resilience testing can also be understood as how well a system/product can bounce back or continue to perform in face of some failure. It is also refereed to as Recoverability testing and this would extend its meaning as to how well the system/product/service can recover from a failure. For example, assuming a we-server went down, Resilience would also test how best it would bounce back with out loss of data or functionality.

Please do share your view about Resilient and Recoverability testing.

Wednesday, May 13, 2015

Data formatting stupidity can make you waste a lot of productive time.

Last night I kept getting JSON related errors, I looked at my java code that was using JSONObject to extract data. Below is what happened and what was learned from it to avoid wasting time (esp when you are burning the midnight oil)

Mistake: Instead of looking at how the data was being handled, once read it from the file, I kept looking at the JSON in the file.

I had JSON data in a text file and I was trying to parse through it. So during the initial code write up, I read the data and stored it all in a String and to be able to confirm that all the data is being read I reinserted the formatting to make it look like how it looked in the text file. I printed it and once satisfied that data was being read correctly, I moved on to implement further functionality .....without.... deleting the debug code.......and reusing the same string object to extract the needed data. Brilliant!!! ain't it.

lesson learned: comment or delete the debug code once its purpose is completed. Always look at how the data is being handled.



Wednesday, December 24, 2014

SoupUI stuck in splash screen on Ubuntu 14.**

I ran into this issue with SoupUI, where the application is stuck at splash screen and nothing else happens. After banging my head, checking Java path, logs and general common mis-configuration possibilities. I decided to Google and BHAM!, it was configuration err..... we lets not say configuration, since there seems to be an dependency related issue with installation of the SoupUI that comes with its own JRE.

So instead of downloading the executable  SoapUI-x32-5.0.0.sh (119.2 MB) (which comes with the JRE in it), we should download SoapUI-5.0.0-linux-bin.tar.gz, just extract it to the desired location and you are good to go. 

I am not sure if this issue is seen with OpenJDK as well, since I had Oracle's JDK 7 installed. 

Monday, May 28, 2012

Installation of PHP5,MySQL and Apache on Ubuntu


This article will describe installation of Apache,MySQL and PHP on a Ubuntu host. This is the most simple and straight forward way to install. If you intent to use the host as just a server and not for everyday desktop/laptop use, then its better install Ubuntu server edition of LTS (Long Term Support), which would be 12.04 as of this writing. Though one can use Tasksel to install the lamp-server, We prefer to install each package at a time. This way we can only install what the server will be used for.

Installation on Ubuntu can be done in three ways:


  • from Ubuntu repositories using apt-get, aptitude or Synaptic package managers.
  • from source file; compiling and installing them individually. (the hardcore method).
  • from the binary packages available at the respective sites.


Installation of  Apache  :

The Apache2 web server is available in Ubuntu repository  as “apache2” package.
  1. Open a terminal window, and use the following command to install Apache2 :

>  sudo apt-get install apache2

     2.  To check whether the Apache2 is stored:

           go to  “/etc” and check for apache2 folder. The folder should  contain main configuration file i.e., “apache2.conf”.

     3.  After making any required changes or after installation, we should restart Apache2  service. this can be done by executing the command:

         >  sudo /etc/init.d/apache2 restart

     4.  Create a new text editor file such as "sudo nano " or "gksudo gedit"

          >sudo nano /etc/apache2/conf.d/fqdn
           or
         >gksu "gedit /etc/apache2/conf.d/fqdn"


Installation of  php5  :


PHP5 is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages.

      1. Open a terminal window, and use the following command to install php5:
         >  sudo apt-get install php5


      2. If you are running PHP you will also need to install the php module for apache2 :
         >  sudo apt-get install libapache2-mod-php5


      3.  To check whether the PHP5 is stored:
 go to  “/etc” and check for php5 folder . The folder should  contain configuration folder i.e., “conf.d”.In this folder there will be all .ini files.



Checking PHP 5 installation :


   1. Create a new text editor file such as "sudo nano " or "gksudo gedit"
> gksudo "gedit /var/www/testphp.php" 2. Write some php code to test php5 or use the following simple codes to test php5. (1) <?php print_r (phpinfo()); ?> (2) <?php echo "Hello, world!"; ?> 3. Run in the browser as “//http://localhost/testphp.php " If you use the 1st test code : You will see the complete information of PHP5 i.e., php version, configuration, apache environment ,......... so on. If you use the 2nd test code : You will see Hello, world! The file “testphp.php” is stored in the /var/www directory. 4. To run PHP5 scripts from command line you should install php5-cli package. To install php5-cli you have to enter the following command in the terminal prompt: >sudo apt-get install php5-cli 5. You can also execute PHP5 scripts without installing PHP5 Apache module. To accomplish this, you should install php5-cgi package. You can run the following command in a terminal prompt to install php5-cgi package: >sudo apt-get install php5-cgi



Installing MySQL 5 Server on Ubuntu is a quick and easy process:


MySQL is a widely spread SQL database management system mainly used on LAMP (Linux/Apache/MySQL/PHP) projects. 1. Open a terminal window, and use the following command to install Mysql5 : > sudo apt-get install mysql-server 2. If you are running PHP you will also need to install the php module for mysql 5: > sudo apt-get install php5-mysql 3. If you have already set a password for the mysql root while installing, then you will need to use: > mysql -u root -p Enter Password:

How-To create a MySQL database and set privileges to a user : In order to be able to use a database, we need to create: a new database, give access permission to the database server to a database user and finally grant all right to that specific database to the user.
  
1. Create a mysql database  :
Syntax :
mysql>  CREATE  DATABASE  <databasename>;
           
            Example:
mysql>create database guest;
 Query OK, 1 row affected (0.00 sec)

      (The above command creates the database called “guest”)
   
      2.  After the database is created, we must select it to continue with our database building.

mysql> use guest;
Database changed
           mysql>


     3. Granting all privileges to new  user :

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost'
                    IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;


     4. Granting fewer privileges to new user  :

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,      ALTER, CREATE TEMPORARY   TABLES, LOCK TABLES ON database1.* TO
'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';
 

Exit from MySQL : 

 To exit the mysql prompt type:
     mysql> \q   
     (or)
     mysql> exit



Important Links:


1) Ubuntu LTS: http://www.ubuntu.com/
2) Apache Project: http://www.apache.org/
3) MySQL: http://www.mysql.com/
4) PHP5: http://www.php.net/
5) LAMP Installation on Ubuntu: https://help.ubuntu.com/community/ApacheMySQLPHP

Tuesday, November 9, 2010

Accessing encrypted home folder using Ubuntu live cd

So my laptop crashed during the upgrade to 10.10.
There was no easy way to recover the system,
so time to back up data. but I did not realize until,
I encrypted the home my home folder. so how to
recover the data for back up.

below is the solution provided by "jrider" from Ubuntu forums.

//Mount the disk partition containing
//the Encrypted Home Directory:
ubuntu@ubuntu$ sudo mount /dev/sda1 /mnt
Establish a proper chroot environment:
ubuntu@ubuntu$ sudo mount -o bind /dev /mnt/dev
ubuntu@ubuntu$ sudo mount -o bind /dev/shm /mnt/dev/shm
ubuntu@ubuntu$ sudo mount -o bind /proc /mnt/proc
ubuntu@ubuntu$ sudo mount -o bind /sys /mnt/sys
ubuntu@ubuntu$ sudo chroot /mnt

//Become the user whose data needs recovery (i.e. “foo”)
//and manually add the necessary mount passphrase to the
//kernel session keyring:

root@ubuntu$ su – foo
foo@ubuntu$ ecryptfs-add-passphrase --fnek
Passphrase:

Mount the encrypted directory and then access the data:
foo@ubuntu$ ecryptfs-mount-private
foo@ubuntu$ cd $HOME
foo@ubuntu$ ls -alF

Friday, October 31, 2008

its 1:34 am!

Life can be easy of it can be tough, it depends on how one sees it. I try to see it in a new way every single time, but the view is still the same and I end up fooling myself thinking its going to be different.

I ask myself, do I like my life?, the answer strikes me "what else can you do?". You can get fatter or thinner, you can be famous for good or bad reasons, But what is the use of it, the world will still be as it was......it might influence some people, but honestly who are we fooling. Even after people like Buddha, Mahatma Gandhi, Martin Luther and thousands others crying out for peace......we still fight and kill. so what has changed and will it change if I stand still.

Friday, June 6, 2008

cool games on LInux.

So finally had some time to play some games on my box and that was then tahti realized that I had not installed good FPS games. so I googled "Top Linux games" (did I forget to mention I Run Ubuntu), saw Nexuiz in the list and installed it.

The following comment is for windows and mac users.
I had to type one line of command "sudo aptitude install nexuiz" and my passowrd and bham! and entire awesome game got install in a few minutes and I din't have to pay a dime for it and its is as good as Quake. oh yeah Quake is also available for Linux....

Its a great game and I was really suprised and realized it was a real cool and awesome. well I knwo there must be awesome ppl who already have written tons about it....so I'll just say this. "cool, adictive and lots of action in this game".