Pages

Friday, December 27, 2013

Selenium in 3 days – day 2 – Getting started with Selenium - Robot Framework

Today you will write your first selenium script. before that, you have to install Python, Selenium and all the supportive tools.






Selenium Robot Framework installation on Python

Step 1: Install supported Python version. (I prefer Python 2.6.6) -http://www.python.org/download/releases/2.6.6/


Step 3: Add Python installation directory and scripts directory (example -C:\Python26; C:\Python26\Scripts) to path variable. That will allow you direct execution.

Step 4: Execute command in command prompt   “pybot --version”.  If you have done all correctly up to now, you will see the robot framework and python versions.

Step 5: In addition, you may install ‘setuptools’ or ‘distribute’.  That will help you to install PIP.
Once installation is complete, you will find an easy_install.exe program in your Python Scripts subdirectory.

Step 6: Install PIP using “easy_install.exe pip” command.

Step 7: Install selenium2library using “pip install robotframework-selenium2library” command.

Optional : Install suitable selenium editor, which is convenient option to customize your script. I prefer RIDE or Ninja IDE.

Install Robot-IDE (RIDE) - RIDE is an editor for Robot Framework
Install Ninja IDE (http://ninja-ide.org/)

TIP 1 : Install firefox addon – “element locator for web driver”. That will help you to find locators (xpaths). Later, you will realize what is a locator and its usages. For now, just install it.

Tip 2: Install firefox addon – “firepath “. This will helps you to customize xpaths. 

TIP 3 : If you suppose to run your selenium test in various browsers you need to install relevant web driver. Just download the correct web driver and place it inside the C:\Python26\Scripts folder. (example – download Chrome web driver from https://code.google.com/p/chromedriver/downloads/list)

Congrats! Now you are ready to write your first selenium script. Here we go!

What are we going to do is,
·         Open firefox browser.
·         Load google site.
·         Search the word given by variable.
·         Validate the page title of the search result page.

There are 5 easy steps to do it.

Step 1: Create a folder named “helloworld” in your python installation directory.

Step 2: Create two sub-folders “resource” and “script” inside the “helloworld” folder.

Step 3: Inside the resource folder, create two files ‘resource.txt’ and ‘objectmap.py’ with below content. (Click on the image to enlarge)
You can see three keywords (‘Open Browser’, ‘Maximize Browser Window’, ‘Set Selenium Speed’) written under test template – ‘Open Browser To Google Home Page’. All these three keywords belong to selenium2library.
Is there any other libraries? 
Yes. There are several selenium libraries display here - http://robotframework.org/#test-libraries You can import relevant library and use it’s keywords.
'objectmap.py' include locators of the search buttons and input field. you can find these locators using the firefox addon – “element locator for web driver”.

Step 4: Now, the most important step of the flow. Create a file ‘helloworld.txt’ inside the script folder with below content.
I think you can easily understand this script. You can find the keywords ‘Input Text’, ‘Click Button’, and ‘Title Should Be’ at the selenium2library. ‘Wait Until Keyword Succeeds’ is a keyword from BuiltIn library.



Step 5: In the final step you are going to run the script in command prompt. Open CMD and navigate the location where ‘helloworld.txt’ placed. Run the script using pybot command.







That’s it! Now you know all the basics to develop any complex script. 
On day-3, I suppose to discuss about some common selenium libraries and their behaviors, working with windows dialog box, working with oracle database using python database library, logs/reporting and some more complex mechanisms. Bye for now and see you soon!
{ Read More }


Thursday, September 26, 2013

Selenium in 3 Days – Day 1 – Introduction to Selenium

Hi Friends, Today I’m going to discuss about selenium automation. Aim of this post is, to introduce selenium for beginners & share selenium skills/experience with our QA community. So, all your valuable comments and feedback are welcome!

What is selenium?
Basically, it’s a browser automation tool, that can be use to record browser actions and play back.

Why selenium?
You can record all the behaviors of your web application and run back after code modification. You can find which sections were breaks (or change) as a result of the modification. That is, you can basically use this for regression testing. Going forward… this can be use as a acceptance testing tool.

Evolution of Selenium
Selenium IDE – This is a Firefox addon that can be use to record browser actions and playback.

Selenium 1 [Remote Control (RC)] – Use Selenium server and Client libraries in various programming languages.

Selenium 2 [web driver] - Use advanced API than selenium-1.


Selenium Grid – Selenium server has a built-in Grid functionality. That will allow you to test with multiple servers and multiple browsers at the same time.



Selenium - Robot Framework
Robot Framework is one of a famous test automation framework that uses the keyword-driven testing mechanism. Its testing capabilities can be extended by test libraries which providing keywords. Let’s discuss about that later. In Simple words, Virtual Robot delivers test data to test libraries (written in python or java) through “Keywords”. Here is the Graphical interpretation of robot framework.
That is all for the day-1.  Hope I have made a good foundation for your selenium training. On day-2, I suppose to energize you with selenium technical details. Also, be ready to write your first selenium code on day-2. Till then, I suggest you to play with Selenium IDE Firefox plugin.
{ Read More }


Thursday, September 5, 2013

Be ready for your first QA interview

Today, I’m not going to explain all the QA interview questions & answers. You can just google and find thousands of QA interview questions. By this post, I wish to share my experience about local QA interviewer’s approach. Also, I want to tell you the way of facing an QA interview.

Tip : Before the interview, search about company and their business.  That will be a good foundation for your preparation.

  • Most of the time, First interview question would be “Can you describe about yourself?”. They want to know details you didn’t mention in your CV. At the same time, they want to check your Language proficiency. Don’t waste much time by telling your personal details and by repeating the details in CV. Just tell about you briefly and describe more about your technical/professional background.
  • One of a basic QA interview question is explain OOP concepts/software development life cycle/QA life cycle or bug life cycle. Check below images to take an idea.

SDLC
QA life cycle
Bug life cycle


  • They may ask about testing types. There are plenty of testing types. But basically, you need to know below list of test types.
    1. Unit testing – Testing individual component or module by developers.
    2. Integration testing – Test the application after integrated(combined) all the components and modules.
    3. Regression testing – After new feature added/changed or fix a bug, test the application to make sure nothing break due to that modification.
    4. Smoke testing – A Quick test to verify the most important functionalities of an application are working.
    5. Black box testing – Without knowledge of internal logic of a system, just test the functionality against requirement.
    6. White box testing – With knowledge of internal logic of a system, test the internal structure and behavior.
  • A very common interview question is, “What is the difference between load and performance tests?”. To answer that question, you need to know what is load testing and what is performance testing.
    1. Load testing –Check the maximum no of requests can handle by a system per unit period. In simple words, what is the maximum no of users can handle by an application when they use same functionality at the same time.
    2. Performance testing – Test the response time of a system. Again, in simple words, how fast users are getting results from the system. simply, test the speed of a system.
  • Another very famous set of questions are,
    1. What is the different between QA and QC?
    2. What is the different between Bug and Defect?
    3. What is the different between severity and priority?
          You can easily find the answers from google.
  • If you are questioned or not, any QA engineer should know the formats of test plan document and test case document. So, get to know that before you going for the interview.
  • Also, you will be questioned about the entry/exit criteria. That is, two different criteria to check before and after the testing conduct.
    1. Entry criteria – Minimum set of conditions should be set to start the testing. (example –unit testing is finished, Test plan and Test case documents are ready, Testing environment is ready…etc )
    2. Exit criteria – Minimum set of conditions should be set to close the testing. (example – No major defects are pending, All test cases are passed, …etc )
  • You will be definitely questioned about bug tracking tools. At least you have to the basics and fields of a bug tracking tool such as JIRA, Bugzilla, Mantis, flyspray …..etc
  • After questioning all above basics, now you will be taken to check more technical skills. For that you may ask to write basic sql queries or ask about different protocol types/ security testing or SQL injection testing methods.
  • Finally, they will ask about your experience of QA tool and technologies. For a person who going to his first QA interview has nothing to say about that. but at least you have to google & take a basic understanding about tools/technologies like selenium, QTP, Quality center, load runner, URL validation tools, UI testing tools… etc. 
From My next post I hope to discuss about these tools and technologies. 
Till then, have a nice day! Good luck!
{ Read More }


Monday, September 2, 2013

Few concerns that Local QA community should be focus

By working 7+ years in local IT industry & by interviewing plenty of QA job seekers, I’m having good experience about the attitude of Sri lankan QA community. 

Why their job treated as less important? Why they get paid less than developers? I would like to discuss few major reasons for that.




Is testing the easiest step in software development life cycle???
Absolutely Not. Why? Before that, I would like to ask another question on top. QA should involve in which step of the SDLC? 4th? Wrong again.
Basically, software quality assurance means finding the differences between customer’s requirement and developer’s output. For that QA engineer should have to have a clear understanding about requirement spec. So, he should involve at the first step of SDLC. Considerable percentage of his duty is depending on documentation. Huge management part is included too. Also QA engineer can use many tools and technologies to ease his life. I have interviewed some fresh graduates that believe QA is the first and easiest step to enter the IT industry. They are not the right choice for a company since they will left their job soon after understand the reality.

Lack of technical skills

Lack of technical skills is the biggest worry about Sri lankan QA engineers.
How many of they can work with WAMP & deploy a tool like test link, mantis or flyspray by themselves?
How many of they can do a small PHP script modification on MANTIS installation?
How many of they can configure ODBC connection or write a simple sql script to verify data without having help of dev guy? It’s very less. So, from company point of view QA guy have to compensate for developer’s lost time.

Lack of Training and Knowledge sharing mechanism.

We don’t conduct proper training for QA engineers and we don’t have any common media or centralized location to share their knowledge /experience. As a result of that, QA fellows are hardly invent new mechanism or tool for their companies. They just use conventional tools and technologies to survive. By experience I know only few QA engineers have expert knowledge of selenium automation. Some guys think, they need massive development knowledge to write a automation script. On the other hand, most of the local IT companies under estimate the value of QA, they don’t like to spend money on commercial QA tools like load runner, QAP, quality center. They mostly rely on manual testing and that will cost more time and effort.

Job dissatisfaction due to un-organized QA structure.

How many IT companies in Sri lanka provide a QA manager for their test team? I think it’s very few. Most of the time, they are reporting to the project manager or development manager.
PMs just have an overall view of the project. They don’t depend much about QA estimation. Just thinking of reaching deadlines & force QA fellows to do last minute testing. That will put QA fellow under more pressure and cause job dissatisfaction.

Job dissatisfaction is a separate topic to be discussed. Anyway, By combining all above points I would say, Local QA community should be focus on improving their technical skills. QA engineer with technical skills is a gem for a company.
{ Read More }


Blogger news

Blogroll

What's Hot