<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Library of WONDERS</title>
	<atom:link href="https://girliemangalo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://girliemangalo.wordpress.com</link>
	<description>Chronicles of my learning on Software Quality Assurance, Technology and Books I read...</description>
	<lastBuildDate>Mon, 01 Feb 2016 06:17:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='girliemangalo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://secure.gravatar.com/blavatar/5056cd5d3ee8788b5e898baf2303e6526edb35e0f641fd8d5a0a4cbb17a96a56?s=96&#038;d=https%3A%2F%2Fs0.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Library of WONDERS</title>
		<link>https://girliemangalo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://girliemangalo.wordpress.com/osd.xml" title="Library of WONDERS" />
	<atom:link rel='hub' href='https://girliemangalo.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Mirror your Android Phone on Mac/PC</title>
		<link>https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/</link>
					<comments>https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Mon, 01 Feb 2016 06:17:25 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1397</guid>

					<description><![CDATA[Vysor is a Chrome add-on that allows you to mirror your Android phone on your Mac or PC when doing presentation through your mobile phone. So far this is the easiest way as it does not require installation of any application whatsoever, plus it allows you to mirror multiple devices as long as it is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Vysor is a Chrome add-on that allows you to mirror your Android phone on your Mac or PC when doing presentation through your mobile phone.</p>
<p>So far this is the easiest way as it does not require installation of any application whatsoever, plus it allows you to mirror multiple devices as long as it is connected to your machine.</p>
<ol>
<li>Launch your Chrome browser and go to Chrome <a href="https://chrome.google.com/webstore/category/apps" target="_blank">webstore</a></li>
</ol>
<p>2. Search for Vysor and click &#8220;Add to Chrome&#8221; button</p>
<p><img data-attachment-id="1435" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-11-08-20-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png" data-orig-size="985,706" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 11.08.20 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=300" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=595" class="aligncenter size-full wp-image-1435" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=595" alt="Screen Shot 2016-01-20 at 11.08.20 am"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png 985w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=150&amp;h=108 150w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=300&amp;h=215 300w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png?w=768&amp;h=550 768w" sizes="(max-width: 985px) 100vw, 985px" /></p>
<p>3. Connect your Android phone to your Mac/PC via USB</p>
<p>4. Launch the Vysor via the Chrome webstore or Chrome App Launcher</p>
<p><img data-attachment-id="1422" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-49-45-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png" data-orig-size="378,401" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 10.49.45 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png?w=283" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png?w=378" class=" size-full wp-image-1422 aligncenter" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png?w=595" alt="Screen Shot 2016-01-20 at 10.49.45 am"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png 378w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png?w=141&amp;h=150 141w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png?w=283&amp;h=300 283w" sizes="(max-width: 378px) 100vw, 378px" /></p>
<p>5. Choose the device that you want to share</p>
<p><img data-attachment-id="1424" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-50-55-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png" data-orig-size="486,510" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 10.50.55 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png?w=286" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png?w=486" class=" size-full wp-image-1424 aligncenter" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png?w=595" alt="Screen Shot 2016-01-20 at 10.50.55 am"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png 486w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png?w=143&amp;h=150 143w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png?w=286&amp;h=300 286w" sizes="(max-width: 486px) 100vw, 486px" /></p>

<a href='https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-54-27-am/'><img width="79" height="150" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=79" class="attachment-thumbnail size-thumbnail" alt="" decoding="async" srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=79 79w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=158 158w" sizes="(max-width: 79px) 100vw, 79px" data-attachment-id="1427" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-54-27-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png" data-orig-size="418,798" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 10.54.27 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=157" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=418" /></a>
<a href='https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-54-36-am/'><img width="78" height="150" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=78" class="attachment-thumbnail size-thumbnail" alt="" decoding="async" srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=78 78w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=156 156w" sizes="(max-width: 78px) 100vw, 78px" data-attachment-id="1428" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-54-36-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png" data-orig-size="413,799" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 10.54.36 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=155" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=413" /></a>

<p>6. Now you can navigate through your mobile phone and project all the user actions in your desktop.</p>
<p><img loading="lazy" data-attachment-id="1431" data-permalink="https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/screen-shot-2016-01-20-at-10-55-00-am/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png" data-orig-size="1624,1440" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2016-01-20 at 10.55.00 am" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=300" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=595" class=" size-full wp-image-1431 aligncenter" src="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=595" alt="Screen Shot 2016-01-20 at 10.55.00 am"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png 1624w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=150&amp;h=133 150w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=300&amp;h=266 300w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=768&amp;h=681 768w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=1024&amp;h=908 1024w, https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png?w=1440&amp;h=1277 1440w" sizes="(max-width: 1624px) 100vw, 1624px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2016/02/01/mirror-your-android-phone-on-macpc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-11-08-20-am.png" medium="image">
			<media:title type="html">Screen Shot 2016-01-20 at 11.08.20 am</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-49-45-am.png" medium="image">
			<media:title type="html">Screen Shot 2016-01-20 at 10.49.45 am</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-50-55-am.png" medium="image">
			<media:title type="html">Screen Shot 2016-01-20 at 10.50.55 am</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-27-am.png?w=79" medium="image" />

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-54-36-am.png?w=78" medium="image" />

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2016/01/screen-shot-2016-01-20-at-10-55-00-am.png" medium="image">
			<media:title type="html">Screen Shot 2016-01-20 at 10.55.00 am</media:title>
		</media:content>
	</item>
		<item>
		<title>Cucumber: Passing Test Data as Table from Scenario</title>
		<link>https://girliemangalo.wordpress.com/2016/01/20/cucumber-passing-test-data-as-table-from-scenario/</link>
					<comments>https://girliemangalo.wordpress.com/2016/01/20/cucumber-passing-test-data-as-table-from-scenario/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Wed, 20 Jan 2016 02:27:59 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1366</guid>

					<description><![CDATA[While we can pass test data as table from the feature file through Scenario Outline: Here&#8217;s another option to pass your data in table format through your step definition. #Step Definitions File]]></description>
										<content:encoded><![CDATA[<p>While we can pass test data as table from the feature file through Scenario Outline:</p>
<pre class="brush: ruby; title: ; notranslate">
Scenario Outline: User updates user information
 Given I login to application
 And I go to user profile page
 And I enter &quot;&lt;gender&gt;&quot; into field of &quot;gender_element&quot;;
 And I enter &quot;&lt;age&gt;&quot; into field of &quot;age_element&quot;;
 And I enter &quot;&lt;location&gt;&quot; into field of &quot;location_element&quot;;
 Then I verify user updates are saved
Examples:
 | gender | age | location |
 | Female | 20 | Singapore |
</pre>
<p>Here&#8217;s another option to pass your data in table format through your step definition.</p>
<pre class="brush: ruby; title: ; notranslate">
Scenario: User updates user information
 Given I login to application
 And I go to user profile page
 When I update user information with options:
  | Gender | Female |
  | Age | 20 |
  | Location | Singapore |
 Then I verify user updates are saved
</pre>
<p>#Step Definitions File</p>
<pre class="brush: ruby; title: ; notranslate">
#step definition to populate textfields
Then /^I enter &quot;(.*)&quot; into field of &quot;(.*)&quot;$/ do |value, field|
 textfield(I18n.translate!(field)).click
 textfield(I18n.translate!(field)).send_keys value
end

#step definition that accepts test data from the feature file as table
When /^I update user information(?: with options:)?$/ do |table|

 options = table.rows_hash
 step %Q[I enter &quot;#{options['Gender']}&quot; into field of &quot;gender_element&quot;]
 step %Q[I enter &quot;#{options['Age']}&quot; into field of &quot;age_element&quot;]
 step %Q[I enter &quot;#{options['Location']}&quot; into field of &quot;location_element&quot;]
 step %Q[I press button labelled &quot;bt_address_suggestion_use_this&quot;] 

#step definition that accepts test data from the feature file as table with default value
When /^I update user information(?: with options:)?$/ do |table|
 default_value = {
 'Age' = &quot;18&quot;,
 'Location' = &quot;United States&quot;
 }
 options = default_value.merge(table.rows_hash)
 step %Q[I enter &quot;#{options['Gender']}&quot; into field of &quot;gender_element&quot;]
 step %Q[I enter &quot;#{options['Age']}&quot; into field of &quot;age_element&quot;]
 step %Q[I enter &quot;#{options['Location']}&quot; into field of &quot;location_element&quot;]
 step %Q[I press button labelled &quot;bt_address_suggestion_use_this&quot;]
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2016/01/20/cucumber-passing-test-data-as-table-from-scenario/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
		<item>
		<title>Cucumber: Using JSON Parser</title>
		<link>https://girliemangalo.wordpress.com/2015/02/25/cucumber-using-json-parser/</link>
					<comments>https://girliemangalo.wordpress.com/2015/02/25/cucumber-using-json-parser/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Wed, 25 Feb 2015 09:01:06 +0000</pubDate>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[cucumber]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1328</guid>

					<description><![CDATA[JavaScript Object Notation(JSON) is a lightweight data-interchange format useful to generate and parse data Sample Data: {&#8216;user&#8217;:{&#8216;FirstName&#8217;:&#8217;User1&#8242;, &#8216;LastName&#8217;:&#8217;Sample&#8217;, &#8216;Gender&#8217;:&#8217;Female&#8217;, &#8216;BirthDate&#8217;:&#8217;01/01/1990&#8242;}} Suppose we are to use the above user data, parse it into an hash and use the array hash as input to a sign up screen. Here&#8217;s a snippet of how to use JSON in this particular [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>JavaScript Object Notation(JSON) is a lightweight data-interchange format useful to generate and parse data</p>
<p>Sample Data:</p>
<p>{&#8216;user&#8217;:{&#8216;FirstName&#8217;:&#8217;User1&#8242;, &#8216;LastName&#8217;:&#8217;Sample&#8217;, &#8216;Gender&#8217;:&#8217;Female&#8217;, &#8216;BirthDate&#8217;:&#8217;01/01/1990&#8242;}}</p>
<p>Suppose we are to use the above user data, parse it into an hash and use the array hash as input to a sign up screen.</p>
<p>Here&#8217;s a snippet of how to use JSON in this particular scenario</p>
<pre class="brush: ruby; title: ; notranslate">

require “json”

my_data = &quot;{'user':{'FirstName':'User', 'LastName':'Sample', 'Gender':'Female', 'BirthDate':'01/01/1990'}}&quot;

##method to parse user data

def getNewUserData

@new_user = JSON.parse my_data

{

:firstName =&gt; new_user['user']['FirstName'],

:lastName =&gt; new_user['user']['LastName'],

:gender =&gt; new_user['user']['Gender'],

:birthDate =&gt; new_user['user']['BirthDate']

}

end

##method to populate the sign up screen

def fillOutSignUpScreen

step %Q[I enter &quot;#{@new_user[:firstName]}&quot; to the &quot;signup.firstname&quot;]

step %Q[I enter &quot;#{@new_user[:lastName]}&quot; to the &quot;signup.lastname&quot;]

step %Q[I enter &quot;#{@new_user[:gender]}&quot; to the &quot;signup.gender&quot;]

step %Q[I enter &quot;#{@new_user[:birthDate]}&quot; to the &quot;signup.birthdate&quot;]

end

</pre>
<p>For more functions and complete library you may refer to http://www.ruby-doc.org/stdlib-2.0/libdoc/json/rdoc/JSON.html</p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2015/02/25/cucumber-using-json-parser/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby: Using URI and HTTPClient</title>
		<link>https://girliemangalo.wordpress.com/2015/02/25/ruby-using-uri-and-httpclient/</link>
					<comments>https://girliemangalo.wordpress.com/2015/02/25/ruby-using-uri-and-httpclient/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Wed, 25 Feb 2015 08:39:53 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[ruby]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1347</guid>

					<description><![CDATA[HTTPClient provides API library for user to access web resource using HTTP This would be helpful if you need to access a different web URL other than your base URL that you used in your automation and validate the content of the page. Here&#8217;s a snippet of how to use HTTPClient in this particular scenario For more functions [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.rubydoc.info/gems/httpclient/2.1.5.2/HTTPClient">HTTPClient</a> provides API library for user to access web resource using HTTP</p>
<p>This would be helpful if you need to access a different web URL other than your base URL that you used in your automation and validate the content of the page.</p>
<p>Here&#8217;s a snippet of how to use HTTPClient in this particular scenario</p>
<pre class="brush: ruby; title: ; notranslate">

require “httpclient”

my_url = “http://CheckThisOut:8080”

##method to access my_url using URI

def accessPage

begin

uri_parsed = URI.parse(my_url)

client = HTTPClient.new()

client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE

client.no_proxy = uri_parsed.host

uri = my_url

#invoke url to take the page content

puts “Accessing: #{uri}”

resp = client.get uri, :header =&gt; {’Accept’ =&gt;‘application/json’}

rescue

puts(“Error encountered: #{$!.inspect}”)

end

end

puts &quot;response: status = #{resp.status}&quot;

puts &quot;response: body = #{resp.body}&quot;

fail &quot;bad response #{resp.status} #{resp.reason}&quot; unless resp.status == HTTP::Status::OK

page_content = resp.body

return page_content

end

</pre>
<p>For more functions and complete library you may refer to http://www.rubydoc.info/gems/httpclient/2.1.5.2/HTTPClient</p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2015/02/25/ruby-using-uri-and-httpclient/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful Git Commands</title>
		<link>https://girliemangalo.wordpress.com/2015/01/25/useful-git-commands/</link>
					<comments>https://girliemangalo.wordpress.com/2015/01/25/useful-git-commands/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Sun, 25 Jan 2015 09:39:28 +0000</pubDate>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[git]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1317</guid>

					<description><![CDATA[As our project migrated from SVN to GIT repository, I thought of writing a post of the usual git commands which I find helpful where I could easily refer to. **Set up Local Repository #clone a repository into a new directory locally git clone &#60;SSH key&#62; #checkout a branch or path to the working tree [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>As our project migrated from SVN to GIT repository, I thought of writing a post of the usual git commands which I find helpful where I could easily refer to.</p>
<p><strong>**Set up Local Repository</strong></p>
<p>#clone a repository into a new directory locally</p>
<p>git clone &lt;SSH key&gt;</p>
<p>#checkout a branch or path to the working tree</p>
<p>git checkout &lt;branch name&gt;</p>
<p><strong>**Working with Branches</strong></p>
<p>#display all the available branches in your local, highlighting the active branch</p>
<p>git branch</p>
<p>#download all/new branches</p>
<p>git fetch</p>
<p>#switch working branch</p>
<p>git checkout &lt;branch name&gt;</p>
<p>#create new branch locally</p>
<p>git checkout -b &lt;branch name&gt;</p>
<p>#push newly created branch to remote</p>
<p>git push -u origin &lt;branch name&gt;</p>
<p><strong>**Committing Local Changes to remote</strong></p>
<p>#show staged files for commit, not staged files for commit and untracked files.</p>
<p>git status</p>
<p>#include what will be committed, stage the changes</p>
<p>git add &lt;file&gt;</p>
<p>#discard changes</p>
<p>git checkout &#8212; &lt;file&gt;</p>
<p>#to add message for commit</p>
<p>git commit -m &#8220;message here&#8221;</p>
<p>#take latest commits on the mentioned branch</p>
<p>git pull origin &lt;branch name&gt;</p>
<p>#push local changes to the remote</p>
<p>git push origin &lt;branch name&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2015/01/25/useful-git-commands/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
		<item>
		<title>Cucumber: Verify page content from a data source</title>
		<link>https://girliemangalo.wordpress.com/2014/07/21/cucumber-verify-page-content-from-a-data-source/</link>
					<comments>https://girliemangalo.wordpress.com/2014/07/21/cucumber-verify-page-content-from-a-data-source/#comments</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Mon, 21 Jul 2014 07:02:37 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[quality assurance]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[capybara]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1283</guid>

					<description><![CDATA[One good practice in &#8220;Cuking&#8221; is to not crowd your feature files with all the text validations. In this post I&#8217;ll be sharing how you can use an external data source to be compared with the actual UI page for content validation purposes. First prepare your textfile by inputting all the expected content in the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One good practice in &#8220;Cuking&#8221; is to not crowd your feature files with all the text validations. In this post I&#8217;ll be sharing how you can use an external data source to be compared with the actual UI page for content validation purposes.</p>
<p>First prepare your textfile by inputting all the expected content in the page you want to assert. Save this in a your desired location which later on you&#8217;ll need to specify in your step definition.</p>
<p>Step Definition</p>
<pre class="brush: ruby; title: ; notranslate">
And /^I verify ([^&quot;]*) page content$/ do |page|
 case page
   when 'Terms and Conditions'
     $file = File.expand_path(File.dirname(__FILE__) + '/{location of your file}/terms_and_conditions.txt')
   #you can add other pages to validate within the case
 end
 $content = File.open($file)
 $content.readlines.each do |line|
   puts &quot;#{line}&quot;
   page.text.should have_content(&quot;#{line}&quot;)
 end
end

</pre>
<p>In your feature file assuming all the other step definitions are in place, you&#8217;ll just need to call your &#8216;I verify ([^&#8221;]*) page content&#8217; step with the page variable in our example &#8216;Terms and Conditions&#8217;</p>
<pre class="brush: ruby; title: ; notranslate">
Scenario: User verify contents of Home page
  Given User go to Terms and Conditions page
  And I verify Terms and Conditions page content
</pre>
<p>In other cases that you nedd to save your text validations in a csv data source, for example maintaining a csv file with all the expected labels per page:</p>
<p><a href="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png"><img loading="lazy" data-attachment-id="1296" data-permalink="https://girliemangalo.wordpress.com/2014/07/21/cucumber-verify-page-content-from-a-data-source/labels/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png" data-orig-size="199,224" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="labels" data-image-description="" data-image-caption="" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png?w=199" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png?w=199" class="size-full wp-image-1296 alignnone" src="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png?w=595" alt="labels"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png 199w, https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png?w=133&amp;h=150 133w" sizes="(max-width: 199px) 100vw, 199px" /></a></p>
<p>Your step definition should look something like this:</p>
<pre class="brush: ruby; title: ; notranslate">
And /^I verify fields from &quot;([^&quot;]*)&quot;$/ do |page|
  $source = &quot;/{location of your file}/fields.csv&quot;
  FasterCSV.foreach(File.expand_path(File.dirname(__FILE__) + &quot;#{$source}&quot;), :headers =&gt; true) do |row|
    begin
      if row.header?(&quot;#{page}&quot;)
        if row[&quot;#{page&quot;] != nil
          puts row[&quot;#{page}&quot;]
          $field = row[&quot;#{page}&quot;]
          page.text.should match(/#{$field}/)
        end
      end
    rescue =&gt; e
      raise e
    end
  end
end

</pre>
<p>Then in your feature file, you just call the step definition with the csv&#8217;s column header as a parameter:</p>
<pre class="brush: ruby; title: ; notranslate">
Scenario: User verify contents of Home page
  Given User go to Login page
   Then I verify fields from &quot;Login Page&quot;
   And User go to Registration Page
   Then I verify fields from &quot;Registration Page&quot;
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2014/07/21/cucumber-verify-page-content-from-a-data-source/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2013/04/labels.png" medium="image">
			<media:title type="html">labels</media:title>
		</media:content>
	</item>
		<item>
		<title>Cucumber: Read from File</title>
		<link>https://girliemangalo.wordpress.com/2012/11/01/cucumber_read_from_fil/</link>
					<comments>https://girliemangalo.wordpress.com/2012/11/01/cucumber_read_from_fil/#comments</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Thu, 01 Nov 2012 12:36:01 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[capybara]]></category>
		<category><![CDATA[erb]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1232</guid>

					<description><![CDATA[As your automated testing mature, you don&#8217;t want to limit users hard coding their application under test or browser driver all in the ENVironment file(env.rb). You can customized your environment by creating a configuration file where you can define variables like applications URL, timeout, database configurations and the like. From the basic folder structure discussed [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>As your automated testing mature, you don&#8217;t want to limit users hard coding their application under test or browser driver all in the ENVironment file(env.rb). You can customized your environment by creating a configuration file where you can define variables like applications URL, timeout, database configurations and the like.</p>
<p>From the basic folder structure discussed in <a href="https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/">Automated Testing with Cucumber + Capybara</a> post, add two more files:</p>
<div>config &gt; environments.yml</div>
<div>
<div>support &gt; custom_config.rb</div>
<div>where:</div>
<p><strong>environments.yml</strong> &#8211; contains all the environment variables that you can use</p>
<pre class="brush: ruby; title: ; notranslate">

google:
 app_host: http://www.google.com

bing:
 app_host: http://www.bing.com

</pre>
<p><strong>custom_config.rb &#8211; </strong>ruby code where you configure your code to read from a specific file</p>
<pre class="brush: ruby; title: ; notranslate">

require &quot;erb&quot;

module CustomConfig
 unless defined? @@env_config
 puts &quot;loading environments.yml...&quot;
 env = (ENV['ENVIRONMENT'] &amp;&amp; ENV['ENVIRONMENT'].to_sym) || :google
 environments = YAML.load(ERB.new(File.read(File.expand_path('../../../config/environments.yml', __FILE__))).result)
 @@env_config = environments[env.to_s]
 raise &quot;No config found for environment: #{env}&quot; unless @@env_config
 end

def env_config
 @@env_config
 end

end

World(CustomConfig)

</pre>
<p>Your base folder should look like these by now:</p>
<div data-shortcode="caption" id="attachment_1253" style="width: 337px" class="wp-caption alignnone"><a href="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png"><img aria-describedby="caption-attachment-1253" loading="lazy" data-attachment-id="1253" data-permalink="https://girliemangalo.wordpress.com/2012/11/01/cucumber_read_from_fil/base_folder2/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png" data-orig-size="327,196" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="base_folder2" data-image-description="" data-image-caption="&lt;p&gt;Revised Base Folder&lt;/p&gt;
" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png?w=300" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png?w=327" class="size-full wp-image-1253 " title="base_folder2" alt="" src="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png?w=595"   srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png 327w, https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png?w=150&amp;h=90 150w, https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png?w=300&amp;h=180 300w" sizes="(max-width: 327px) 100vw, 327px" /></a><p id="caption-attachment-1253" class="wp-caption-text">Revised Base Folder</p></div>
<p>Then edit your <strong>env.rb</strong> by adding the following lines to your environment file.</p>
<p>require File.expand_path(&#8216;../custom_config&#8217;, __FILE__)<br />
include CustomConfig</p>
<p>Also update <strong>Capybara.app_host</strong> definition to look up to @@env_config. Your env.rb file should be edited to something like this:</p>
<p><strong>env.rb</strong></p>
<pre class="brush: ruby; title: ; notranslate">

require 'capybara'
require 'capybara/cucumber'
require File.expand_path('../custom_config', __FILE__)
include CustomConfig

Capybara.default_driver = :selenium
Capybara.app_host = env_config['app_host']
Capybara.default_wait_time = 20

World(Capybara)

</pre>
<p>Notice in line #07 of your <strong>env.rb</strong> you are basically pointing app host to whatever environment you set in your <strong>custom_config.rb</strong> &#8211; <strong>env</strong> variable, (see line #06) for this example <strong>:google</strong></p>
<p>From here on you should still be able to run your simple_search.feature file without error, the only difference is your code reads now from a specific file &#8211; <strong>environments.yml</strong>, through <strong>custom_config.rb.</strong></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2012/11/01/cucumber_read_from_fil/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder2.png" medium="image">
			<media:title type="html">base_folder2</media:title>
		</media:content>
	</item>
		<item>
		<title>Improve Writing your Cukes</title>
		<link>https://girliemangalo.wordpress.com/2012/11/01/improve-writing-your-cukes/</link>
					<comments>https://girliemangalo.wordpress.com/2012/11/01/improve-writing-your-cukes/#respond</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Thu, 01 Nov 2012 12:27:12 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[capybara]]></category>
		<category><![CDATA[ruby]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1189</guid>

					<description><![CDATA[Based from the simple_search.feature that we have in Automated Testing with Cucumber + Capybara, we don&#8217;t want to limit users by writing element locators like id, css or xpaths, hardcoding search strings and validations in our Cucumber scenarios: Simple search scenario We can improve this 5-liner scenario by creating new step definition that accepts variable [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Based from the simple_search.feature that we have in <a href="https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/">Automated Testing with Cucumber + Capybara</a>, we don&#8217;t want to limit users by writing element locators like id, css or xpaths, hardcoding search strings and validations in our Cucumber scenarios:</p>
<p><strong>Simple search scenario</strong></p>
<pre class="brush: ruby; title: ; notranslate">

Scenario: A simple google search scenario
Given I am on the main google search
When I fill in &quot;q&quot; with &quot;Cucumber test&quot;
And I click &quot;gbqfb&quot; button
And I click on the first result
Then I should see &quot;Cucumber lets software development teams describe how software should behave in plain text.&quot;

</pre>
<p>We can improve this 5-liner scenario by creating new step definition that accepts variable and reusing the previous step definitions in the new step.</p>
<p><strong>Better search scenario</strong></p>
<pre class="brush: ruby; title: ; notranslate">

Scenario: The better way to do google search
Given I am on the main google search
When I search for &quot;Cucumber test&quot;
Then I verify first search result have &quot;Cucumber lets software development teams describe how software should behave in plain text.&quot;

</pre>
<p>In order to make this new scenario running, we need to define the new step definitions:</p>
<pre class="brush: ruby; title: ; notranslate">

Given /^I search for &quot;([^\&quot;]*)&quot;$/ do |query|
 step %{I fill in &quot;q&quot; with &quot;#{query}&quot;}
 step %{I click &quot;gbqfb&quot; button}
end

Then /^I verify first search result have &quot;([^\&quot;]*)&quot;$/ do |text|
 step %{I click on the first result}
 step %{I should see &quot;#{text}&quot;}
end

</pre>
<p>But wait, there&#8217;s even a better approach to present this scenario where we will use one of the Gherkin keyword &#8220;Scenario Outline.&#8221; Outline allows us to parameterized our test data by passing it to Examples.</p>
<p><strong>Best search scenario</strong></p>
<pre class="brush: ruby; title: ; notranslate">
Scenario Outline: The best way to do google search
 Given I am on the main google search
 When I search for &quot;&lt;String&gt;&quot;
 Then I verify first search result have &quot;&lt;Search criteria&gt;&quot;

Examples:
 | String         | Search criteria   |
 | Cucumber tests | Cucumber          |
 | Selenium       | What is Selenium? |

</pre>
<p>Hope you had a great time, just like me. <strong>Happy Cuking!</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2012/11/01/improve-writing-your-cukes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
		<item>
		<title>Automated Testing with Cucumber + Capybara</title>
		<link>https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/</link>
					<comments>https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/#comments</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Mon, 29 Oct 2012 09:15:53 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[capybara]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1164</guid>

					<description><![CDATA[In this post we will introduce another gem called Capybara. Capybara is an acceptance testing framework with a higher level API and support for multiple backends, supports Selenium and runs in different browsers. Others may ask, &#8220;Why would I use capybara if selenium could also drive the browser the way I want it?&#8221;  Well, one [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will introduce another gem called Capybara.</p>
<p>Capybara is an acceptance testing framework with a higher level API and support for multiple backends, supports Selenium and runs in different browsers.</p>
<p>Others may ask, <em>&#8220;Why would I use capybara if selenium could also drive the browser the way I want it?&#8221;</em>  Well, one advantage I appreciate is Capybara&#8217;s higher-level API compared to selenium.</p>
<p>Let&#8217;s take for example a simple scenario of typing strings to an input textbox:</p>
<p>Selenium-webdriver snippet</p>
<pre class="brush: ruby; title: ; notranslate">

require 'selenium-webdriver'

element = driver.find_element :name =&gt; &quot;q&quot;
element.send_keys &quot;Cucumber tests&quot;

</pre>
<p>Capybara snippet</p>
<pre class="brush: ruby; title: ; notranslate">
require 'capybara'

fill_in &quot;q&quot;, &quot;Cucumber tests&quot;

</pre>
<p>You can obviously see from this example that Capybara enforces easier writing scripts ability. For a complete documentation on Capybara you can check this <a href="http://rubydoc.info/github/jnicklas/capybara/">link</a> from Github which I found very helpful.</p>
<p>After installation setup discussed in my previous post <a href="https://girliemangalo.wordpress.com/2012/10/29/introduction-to-cucumber/"><strong>Introduction to Cucumber</strong></a>, you need to have the following folder structure and files:</p>
<p><strong>I. Base Folder</strong></p>
<div data-shortcode="caption" id="attachment_1234" style="width: 264px" class="wp-caption alignnone"><a href="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png"><img aria-describedby="caption-attachment-1234" loading="lazy" data-attachment-id="1234" data-permalink="https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/base_folder-2/" data-orig-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png" data-orig-size="435,344" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="base_folder" data-image-description="" data-image-caption="&lt;p&gt;Base Folder Structure&lt;/p&gt;
" data-medium-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=300" data-large-file="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=435" class=" wp-image-1234    " title="base_folder" alt="" src="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=254&#038;h=201" height="201" width="254" srcset="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=254&amp;h=201 254w, https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=150&amp;h=119 150w, https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png?w=300&amp;h=237 300w, https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png 435w" sizes="(max-width: 254px) 100vw, 254px" /></a><p id="caption-attachment-1234" class="wp-caption-text">Base Folder Structure</p></div>
<p>where:</p>
<p>features &#8211; folder to host all your feature files</p>
<p>step_definitions &#8211; folder to host all your step definition Ruby files</p>
<p>support &#8211; folder to host your configuration files (env.rb)</p>
<p>Gemfile &#8211; defines the top-level gems to be used in your project</p>
<p><strong>II. Features</strong></p>
<p>&#8211; describes the features that a user will be able to use in the program</p>
<p>Sample: simple_search.feature</p>
<pre class="brush: ruby; title: ; notranslate">

Feature: As a user I should be able to perform simple google search

Scenario: A simple google search scenario
 Given I am on the main google search
 When I fill in &quot;q&quot; with &quot;Cucumber test&quot;
 And I click &quot;gbqfb&quot; button
 And I click on the first result
 Then I should see &quot;Cucumber lets software development teams describe how software should behave in plain text.&quot;

</pre>
<p><strong>III. Step Definition</strong></p>
<p>&#8211; describes the actions that user will do for each step.</p>
<p>Sample: search_step.rb</p>
<pre class="brush: ruby; title: ; notranslate">
Given /^I am on the main google search$/ do
 visit ('/')
end

When /^(?:|I )fill in &quot;([^&quot;]*)&quot; with &quot;([^&quot;]*)&quot;$/ do |field, value|
 fill_in(field, :with =&gt; value)
end

Then /^I click &quot;([^&quot;]*)&quot; button$/ do |button|
 click_button(button)
end

Then /^I click on the first result$/ do
 find(:xpath, &quot;//html/body/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[2]/div/ol/li/div/h3/a&quot;).click
end

Then /^I should see &quot;([^&quot;]*)&quot;$/ do |text|
 page.should have_content(text)
end
</pre>
<p><strong>IV. Support</strong></p>
<p>&#8211; hosts all configuration files</p>
<p>Sample: env.rb</p>
<pre class="brush: ruby; title: ; notranslate">
require 'capybara'
require 'capybara/cucumber'

Capybara.default_driver = :selenium
Capybara.app_host = &quot;http://www.google.com&quot;
Capybara.default_wait_time = 20

World(Capybara)

</pre>
<p><strong>V. Gemfile</strong></p>
<p>&#8211; a format for describing gem dependencies required to execute Ruby codes</p>
<p>Sample: Gemfile</p>
<pre class="brush: ruby; title: ; notranslate">

source &quot;http://rubygems.org&quot;

group(:test) do
 gem 'cucumber'
 gem 'capybara'
 gem 'rspec'
end

</pre>
<p><strong>VI. Run</strong></p>
<p>Using terminal go to your root project folder and type: cucumber or bundle exec cucumber</p>
<p>After the run, you should be able to see the results like this:</p>
<p>1 scenario (<span style="color:#339966;">1 passed</span>)<br />
5 steps (<span style="color:#339966;">5 passed</span>)<br />
0m9.461s</p>
<p>This example runs smoothly in Windows 7. Let me know if it works for you as well.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>

		<media:content url="https://girliemangalo.wordpress.com/wp-content/uploads/2012/10/base_folder1.png" medium="image">
			<media:title type="html">base_folder</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to Cucumber</title>
		<link>https://girliemangalo.wordpress.com/2012/10/29/introduction-to-cucumber/</link>
					<comments>https://girliemangalo.wordpress.com/2012/10/29/introduction-to-cucumber/#comments</comments>
		
		<dc:creator><![CDATA[girlie]]></dc:creator>
		<pubDate>Mon, 29 Oct 2012 09:13:18 +0000</pubDate>
				<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<guid isPermaLink="false">http://girliemangalo.wordpress.com/?p=1155</guid>

					<description><![CDATA[More than a testing tool, Cucumber is a collaboration tool. It is designed to accommodate both the technical(developers, automation testers) and non-technical(stakeholders, product owners) members of the software development team. Cucumber supports behavior-driven development(BDD). In BDD, users(business analysts, product owners) first write scenarios or acceptance tests that describes the behavior of the system from the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>More than a testing tool, <strong>Cucumber</strong> is a collaboration tool.</p>
<p>It is designed to accommodate both the technical(developers, automation testers) and non-technical(stakeholders, product owners) members of the software development team.</p>
<p>Cucumber supports behavior-driven development(BDD). In BDD, users(business analysts, product owners) first write scenarios or acceptance tests that describes the behavior of the system from the customer&#8217;s perspective, for review and sign-off by the product owners before developers write their codes.</p>
<p>When you run your test, Cucumber reads through user-readable files called <strong>features</strong>, parse it to <strong>scenarios</strong> which contains set of steps that are then matched to a <strong>step definitions</strong> of Ruby code using a regular expression.</p>
<p>Feature files could be deceiving. It may look simple and plain in the outside. But complex in the inside, within step definition or the ruby files which controls the flow of actions and where all the magic happens.</p>
<p>In order for Cucumber to understand the feature files, it uses a basic syntax called <strong>Gherkin</strong>. Gherkin makes use of the following keywords for documentation and readability &#8212; Feature, Background, Scenario, Given, When, Then, And, But, *, Scenario Outline and Examples.</p>
<p>To dive more information about <strong><a href="https://github.com/cucumber/cucumber/wiki" target="_blank">Cucumber</a></strong>, I would recommend you read <strong><a href="http://pragprog.com/book/hwcuc/the-cucumber-book">The Cucumber Book</a> </strong> which have valuable information you would need in learning this new technology.</p>
<p>In preparation to  your Cucumber testing experience, will be needing to setup the following in your local machine.</p>
<p>1. Java installation &#8211; JRE will do, mine is Java(TM) SE Runtime Environment 1.6</p>
<p>2. Ruby installation &#8211; visit their <a href="http://www.ruby-lang.org/en/downloads/">Downloads</a> page. I have Jruby 1.6.7.2 installed in my box.</p>
<p>Don&#8217;t forget to define Java and Ruby Path in your system&#8217;s environment variables as well.</p>
<p>3. RubyGems installation &#8211; use &#8220;gem install &lt;name of gem&gt;&#8221; command. Here are some of the basic, helpful gems:</p>
<p>&#8211; Cucumber</p>
<p>&#8211; Capybara</p>
<p>&#8211; Rspec</p>
<p>If you&#8217;re all setup, feel free to jump to the next post &#8211; <a href="https://girliemangalo.wordpress.com/2012/10/29/automated-testing-with-cucumber-capybara/"><strong>Automated Testing with Cucumber + Capybara</strong></a></p>
<p>Reference: The Cucumber Book by Matt Wynne and Aslak Hellesoy</p>
]]></content:encoded>
					
					<wfw:commentRss>https://girliemangalo.wordpress.com/2012/10/29/introduction-to-cucumber/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		
		<media:content url="https://2.gravatar.com/avatar/529f5da627cab0526783d6ea9c6300c7daffe547ec7ddfec9a52e26777abe5d3?s=96&#38;d=https%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">girlie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
