Saturday, March 9, 2013

Difference between keyword driven and data driven framework ?

Data-Driven Testing
Simple test scripts have test data embedded into them. This leads to a problem that when test data needs to be updated actual script code must be changed. This might not be a big deal for the person who originally implemented the script but for a test engineer not having much programming experience the task is not so easy. If the script is long and non-structured the task is hard for everyone. Another problem with having the test data inside test scripts is that creating similar tests with slightly different test data always requires programming. The task may be easy original script can be copied and test data edited but at least some programming knowledge is still required. This kind of reuse is also problematic because one particular change in the tested system may require updating all scripts. Because of these problems embedding test data into scripts is clearly not a viable solution when building larger test automation frameworks. A better approach is reading the test data from external data sources and executing test based on it. This approach is called data-driven testing External test-data must be easily editable by test engineers without any programming skills. It is often in tabular format and edited in spreadsheet programs.

Keyword-Driven Testing
Previous section introduced data-driven testing and stated that it has multiple promises. It also mentioned that its biggest limitation is that all test cases are similar and creating totally new tests requires programming effort. A solution for this limitation, among others, is the keyword-driven approach where not only the test data but also directives telling what to do with the data are taken from test scripts and put into external input files. These directives are called keywords and test engineers can use them to construct test cases freely. The basic idea reading test data from external files and running tests based on it stays the same as in data-driven testing. keyword-driven testing is a logical extension to data-driven testing. 


Data Driven Framework :
It is nothing but data driven test, performing the same functionality with multiple input values by using parametrization with the help of data table or data source is called Data Driven Test.

Keyword Driven Framework :
It is nothing but keyword driven test or keyword view, used for parametrization.
It is dividing into 4 parts.
1. item     2. operation     3. value      4. documentation     ----> in QTP 8.2
In QTP 6.5 keyword view is nothing but Tree View. It displays the list of objects along with logical names.

Parametrization:
passing the run-time input values with the help of data-table or data-source is called parametrization.
Any queries

prashantlogic@gmail.com

Monday, January 21, 2013

Difference Between JUnit And TestNG Annotations



Difference Between JUnit And TestNG Annotations

Features JUnit Annotations TestNG Annotations
Test annotation. @Test @Test
Run before all test in this suite have run. -- @BeforeSuite
Run after all test in this suite have run. -- @AfterSuite
Run before the test. -- @BeforeTest
Run after the test. -- @AfterTest
Run before the first test method that belongs to any of these group is invoked. -- @BeforeGroup
Run after the last test method that belongs to any of these group is invoked. -- @AfterGroup
Run before the first test method in the current class is invoked. @BeforeClass @BeforeClass
Run after all the test method in the current class have been run. @AfterClass @AfterClass
Run before each test method. @Before @BeforeMethod
Run after each test method. @After @AfterMethod
IgnoreTest @ignore @Test(enable=false)
Expected Exception @Test(Expected=ArithmeticException.Class) @Test(ExpectedExceptions=ArithmeticException.Class)
TimeOut @Test(timeout=1000) @Test(timeout=1000)
Thanks From Prashant Chauhan

5 Questions You Should Never Ask in a Job Interview


Could these words be costing you your dream job?

By Catherine Conlan, Monster Contributing Writer

Hiring managers and HR pros will often close out a job interview by asking an applicant if he or she has any questions themselves. This is a great opportunity to find out more about the job and the company's expectations, but you can't forget that the interviewer hasn't stopped judging YOU. Here are 5 questions that can make a bad impression on your interviewer, scuttling your chances for getting the job.

1. When will I be promoted ?


This is one of the most common questions that applicants come up with, and it should be avoided, says Rebecca Woods, Vice President of Human Resources at Doherty Employer Services in Minneapolis. "It's inappropriate because it puts the cart before the horse."  Instead of asking when the promotion will occur, Woods says a better approach is to ask what you would need to do to get a promotion.

2. What's the salary for this position ?


Asking about salary and benefits in the first interview "always turns me off," says Norma Beasant, founder of Talento Human Resources Consulting and an HR consultant at the University of Minnesota. "I'm always disappointed when they ask this, especially in the first interview." Beasant says the first interview is more about selling yourself to the interviewer, and that questions about salary and benefits should really wait until a later interview.

3. When can I expect a raise ?


Talking about compensation can be difficult, but asking about raises is not the way to go about it, Woods says. So many companies have frozen salaries and raises that it makes more sense to ask about the process to follow or what can be done to work up to higher compensation level. Talking about "expecting" a raise, Woods says, "shows a person is out of touch with reality."

4. What sort of flextime options do you have ?


This kind of question can make it sound like you're interested in getting out of the office as much as possible. "When I hear this question, I'm wondering, are you interested in the job?" Beasant says. Many companies have many options for scheduling, but asking about it in the first interview is "not appropriate," Beasant says.

5. Any question that shows you haven't been listening. 


Woods said she interviewed an applicant for a position that was 60 miles from the person's home. Woods told the applicant that the company was flexible about many things, but it did not offer telecommuting. "At the end of the interview, she asked if she would be able to work from home," Woods says. "Was she even listening? So some 'bad questions' can be more situational to the interview itself."

With the economy the way it is, employers are much more choosy and picky, Beasant says. Knowing the questions to avoid in an interview can help you stand out -- in a good way.


Thursday, January 10, 2013

The Difference Between Cookies and Sessions.

The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not. This difference determines what each is best used for.

A cookie can keep information in the user's browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie. The trouble is that a user can block cookies or delete them at any time. If, for example, your website's shopping cart utilized cookies, and a person had their browser set to block them, then they could not shop at your website.

Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn't be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.

You can of course get the best of both worlds! Once you know what each does, you can use a combination of cookies and sessions to make your site work exactly the way you want it to.

Wednesday, November 28, 2012

Networking Definition

  1. SMTP: SMTP (Simple Mail Transfer Protocol) is a set of standard Internet procedures by which two email providers (ex. Gmail, Yahoo Mail), transfer email messages to one another’s mail servers.
  2. domain: A domain is a name for an IP address and is more commonly recognized as a website or web address. For example, Google.com is a domain.
  3. SSL: SSL (secure socket layer) is a way of changing data such as your username and password into code as it travels across the Internet, so that the data will be secure and private.
  4. ISP: An ISP (Internet Service Provider) is a company (ex. AOL, AT&T, and Comcast) that gives your computer Internet access. ISPs are usually the companies that come to your house and set up all the wires.
  5. TLS: TLS (Transport Layer Security) is a way of changing data such as your username and password into code as it travels across the Internet, so that the data will be secure and private. With mail delivery, TLS begins with an unsecured connection to the mail servers, and then upgrades to a secure connection once information is sent.
  6. POP: POP (Post office protocol) is a one-way download of your messages that allows you to access your mail with a mail program like Outlook Express or Apple Mail. POP only offers one-way communication, which means that actions you take in the mail program (like marking a message as read) won’t be synced to Gmail.
  7. IMAP: IMAP (Internet message access protocol) lets you download messages from Gmail so you can access your mail with a program like Outlook Express or Apple Mail. IMAP syncs the actions you take in Outlook Express or Apple Mail with Gmail so if you read a message in your mail client, it'll be marked as read in Gmail.

Friday, November 2, 2012

Switching Frame and Windows in WebDriver sample code


1> Switch to different Frames:
 List<WebElement> frameset = driver.findElements(By.tagName("frame"));  
 if(frameset.size()>0) {  
 for (WebElement framename : frameset){  
 System.out.println("frameid: " + framename.getAttribute("name"));  
 }  
 }  
 else System.out.println("can not find any frame in HTML");  

Notice when you set the frame index, it starts with 0 for the first frame:
 driver.switchTo().frame(0);  


2> Switch to different Windows:
 Set<string> handlers = driver.getWindowHandles();  
 if (driver.getWindowHandles().size()>= 1){  
 for(String handler : handlers){  
 driver.switchTo().window(handler);  
 if (driver.getCurrentUrl().contains("Popup")){  
 System.out.println("Get focus on Popup window");  
 break;  
 }  
 }  
 }  
 else System.out.println("No windows founded!");  


Writing a common function based you own app for switching will be more helpful for your Code Clean!

Saturday, September 8, 2012

AutoIt Tools Related Concept !!!


AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!
AutoIt was initially designed for PC “roll out” situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect.
Features:
  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 2000 / XP / 2003 / Vista / 2008 / Windows 7 / 2008 R2
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista’s User Account Control (UAC)
AutoIt has been designed to be as small as possible and stand-alone with no external .dll files or registry entries required making it safe to use on Servers. Scripts can be compiled into stand-alone executables withAut2Exe.
Also supplied is a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!
Best of all, AutoIt continues to be FREE – but if you want to support the time, money and effort spent on the project and web hosting then you may donate.
Take me to the downloads page!
download autoit AutoIt

Features

Basic-like Syntax and Rich Function Set
AutoIt has a BASIC-like syntax which means that most people who have ever written a script or used a high-level language should be able to pick it up easily.
Although it started life as a simple automation tool, AutoIt now has functions and features that allow it to be used as a general purpose scripting language (with awesome automation as well of course!). Language features include:
  • The usual high-level elements for functions, loops and expression parsing
  • A staggering amount of string handling functions and a Perl compatible regular expression engine (using the PCRE library).
  • COM support
  • Call Win32 and third-party DLL APIs
Built-in Editor with Syntax Highlighting
AutoIt comes with a customised “lite” version of SciTe that makes editing scripts easy. Users can alsodownload a complete version of SciTe that includes additional tools to make things even easier.
Standalone and Small
AutoIt is a very small and standalone application with no reliance on massive runtimes like .NET or VB. All you need to run AutoIt scripts are the main AutoIt executable (AutoIt3.exe) and the script. Scripts can also be encoded into standalone executables with the built-in script compiler Aut2Exe.
International and 64-bit Support
AutoIt is fully Unicode aware and also includes x64 versions of all the main components! How many other free scripting languages can you say that about?
Key and Mouse Simulation
Much time has been spent optimizing the keystroke and mouse simulation functions to be as accurate as possible on all versions of Windows. All the mouse and keyboard routines are highly configurable both in terms of simulation “speed” and functionality.
Window Management
You can expect to move, hide, show, resize, activate, close and pretty much do what you want with windows. Windows can be referenced by title, text on the window, size, position, class and even internal Win32 API handles.
Controls
Directly get information on and interact with edit boxes, check boxes, list boxes, combos, buttons, status bars without the risk of keystrokes getting lost.  Even work with controls in windows that aren’t active!
Graphical User Interfaces (GUIs)
AutoIt v3 will also allow you to create some complex GUIs – just like those below!
gui eg1 AutoIt gui eg2 AutoIt
And much, much more.
You’ll probably want to go to the downloads page right now…