Select Page

Category Selected: 2016

53 results Found


People also read

API Testing

Postman API Automation Testing Tutorial

Automation Testing

Top 10 AI Automation Testing Tools

Automation Testing

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility

Why is the Cucumber tool for BDD named as such?

We would like to share Aslak Hellesøy’s (the creator of Cucumber) reply in Quora for “Why is the Cucumber tool for BDD named as such”. Interesting answer worth reading.

This is going to be a little long – I’ll take the opportunity to explain a little more of the history of some BDD tools.

Around 2005-2007 I was involved in the RSpec open source project – the first popular BDD framework for Ruby.

In 2007 Dan North (who invented BDD) had just donated his rbehave tool to the RSpec project where it was renamed to the RSpec Story Runner. Dan is a starter.

David Chelimsky who was the lead of the RSpec project refactored the story runner so it could read stories from plain text instead of a Ruby DSL – using a simple regex based parser. This was now the first tool in the world to allow executable specifications to be written in plain text using Given/When/Then.

I thought the RSpec Story Runner was a fantastic idea and I started to devote my energy towards improving it. One of the first things I did was to rewrite the parser using Treetop. About a year later, in the spring of 2008 I had a lot of ideas for improvements.

I wanted users to have better error messages. I wanted to make it easier to use by printing step definition snippets and report results in colours. I wanted non-English speakers to use the tool, so I wanted to translate Given/When/Then to other languages. And a lot more.

Implementing these changes was very hard to accomplish without making deep changes to RSpec itself, which RSpec Story Runner depended upon. The two projects had very different goals – RSpec was primarily for programmers, while RSpec Story Runner aspired to be a tool for the whole team, including non-technical stakeholders.

So on the 8th of April 2008 I made my first commit in a codebase that I wanted to become a better, standalone rewrite of the RSpec Story Runner. I temporarily named it Stories for lack of a better name.

I knew this thing could be big – I just knew it! But that would never happen with a boring name like Stories. Can you imagine using a tool called Stories?

So after three days of hacking on my new baby I was on a 3 hour bus ride from Oslo towards Risør with my fiancee. She couldn’t care less about programming, but I always admired her sense of aesthetics and good taste, so I asked her:

Patty, I need a name for this new tool I just started hacking on. I want it to have a catchy, non-geeky sounding name.

She paused for a few seconds, then said: Cucumber!

And I thought: Cucumber? Really? Well, it’s a lot better than Stories – so I’ll go with that for now. I’ll rename it again when I come up with something better.

8 years later I still haven’t come up with a better name. And now there are hundreds of thousands of people using Cucumber every day, from small tech startups to fortune 500 companies.

Crazy

Source Quora: https://www.quora.com/Why-is-the-Cucumber-tool-for-BDD-named-as-such

SeleniumHQ CI

Do you want to use Selenium beta version or to track recent changes as soon as Selenium CI build is done?

You can view all Selenium Jenkinsjobs and download latest Selenium standalone jar from http://ci.seleniumhq.org:8080.

Selenium Jenkins

Latest Selenium standalone jar download

To download latest Selenium standalone jar, select’ Build_All_Java’ job and click selenium-server-standalone-latest.jar link.

Clicking WPF Button

We can automate Windows Presentation Foundation (WPF) applications using QTP with WPF-Addin. But is it possible to automate without addin?

Yes, it is possible. Microsoft launched System.Windows.Automation class with .Net 3.0 Framework. This is also called UI Automation class in .Net. Using this class we can automate WPF applications.We will see how to automate a WPF application using UI Automation class and QTP DOT Net Factory in the forthcoming articles.

First, we start by clicking a WPF button. I have used the below ExpenseIt Standalone WPF application for this implementation.

Expertit Standalone - Clicking WPF Button

 

Code

'WPF_ClickButton function with two arguments
'Argument 1: inWindowHwnd - Window Handle
'Argument 2: strButtonName - Button Name (In this example, the button name is ‘Create Expense Report’)

Function WPF_ClickButton(ByVal inWindowHwnd,ByVal strButtonName)
Dim oTreeScope, oAutomationElement
Dim oInvokePattern, oInptr, oPropertyCondition


'TreeScope object to specify scope of elements
Set oTreeScope=DotNetFactory.CreateInstance("System.Windows.Automation.TreeScope","UIAutomationTypes")

'AutomationElement object is used to retrieve the element
Set oAutomationElement=DotNetFactory.CreateInstance("System.Windows.Automation.AutomationElement","UIAutomationClient")

'PropertyCondition object to search the button with Name property, here it takes strButtonName argument as second constructor.
Set oPropertyCondition=DotNetFactory.CreateInstance(" System.Windows.Automation.PropertyCondition","UIAutomationClient",oAutomationElement.NameProperty,strButtonName)

'Since Button control comes under InvokePattern, we need this object to invoke a button.
Set oInvokePattern=DotNetFactory.CreateInstance("System.Windows.Automation.InvokePattern","UIAutomationClient")

'In .Net, Window Handle cannot be taken as Integer or String; it should be passed as IntPtr structure. That is why here inWindowHwnd argument is supplied as constructor for IntPtr object.
Set oInptr=DotNetFactory.CreateInstance("System.IntPtr","",inWindowHwnd)

'Getting the WPF Form using FromHandle method.
Set oAutomationElement=oAutomationElement.FromHandle(oInptr)

'Searching the Button with Name and assigning into oInvokePattern object
Set oInvokePattern=oAutomationElement.FindAll(oTreeScope.Children,oPropertyCondition)(0).GetCurrentPattern(oInvokePattern.Pattern)

'Clicking the button with Invoke button
oInvokePattern.Invoke()

'Killing the objects
Set oTreeScope=Nothing
Set oAutomationElement=Nothing
Set oPropertyCondition=Nothing
Set oInvokePattern=Nothing
Set oInptr=Nothing
End Function

Dim inWindowHandle

'Getting Window handle property using GetRoProperty
inWindowHandle=Window("text:=ExpenseIt Standalone").GetRoProperty("hwnd")

'Call WPF_ClickButton function with Window Handle and Button name
WPF_ClickButton inWindowHandle,"Create Expense Report"
  

Synopsis

From this article you have learnt how to click a WPF button. Using Microsoft UI Automation API, we can automate WPF applications.
 
Note: This implementation can be done from .Net 3.0 Framework onward.

XPath Based QTP Object Identification

XPath object identification is a new feature in QTP 11. We would like to share an example for it using Google web page.

Code

Dim oPage:Set oPage=Browser("name:=Google").Page("title:=Google")

'Entering value in Google textbox
oPage.WebEdit("xpath:=//INPUT[@name='q']").Set "advancedqtp"

'Clicking Google Search button.
oPage.WebButton("xpath:=//INPUT[@value='Google Search']").Click
  

Use WMI Code Creator Tool for Quick WMI Scripting

Are you searching for WMI codes? Or do you want to know about WMI classes and properties?

Microsoft has created an application to reduce our WMI scripting time, it is WMI Code Creator and a free tool from Microsoft. You can download it from the below link,

WMI Scripting

This tool reduces our WMI scripting time. If anyone uses this tool, please include your comments. It may encourage QTP developers to opt this tool for quick WMI scripting.

XPath Examples for QTP Web Objects

XPath Examples for QTP Web Objects

QTP XPath examples to identify web objects. XPath is a language for addressing parts of an XML document. Xpath expressions to select nodes or node-sets in an XML document.

In this blog, we have listed some useful XPath locating techniques for QTP (Automation Testing Tool). If you are a beginner, you can refer this list to improve object locating strategy.

Identifying using ID attribute

obj.WebEdit("xpath:=//input[@id='htmlID']").Set "QTP"  
  

Identifying using Type attribute

'Setting value in first textBox
obj.WebEdit("xpath:=//input[@type='text'][1]").Set "QTP"
  

Identifying using Tagname

'Highlighting first listBox
obj.WebList("xpath:=//select[1]").Select "London"
  

Identifying using Innertext

'Clicking Google link
obj.Link("xpath:=//a[.='Google']").Click
  

Identifying WebTable based on Rowcount

'Highlighting the table which has only two rows
obj.WebTable("xpath:=//table[count(.//tr)=2]").Highlight