Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
Experience Sitecore! | December 2015

Experience Sitecore!

Martin Miles on Sitecore

Final post of the year

Dear friends,

This is my final post for this year, I will be on holiday from today and till the first decade of 2016. I want to say warm thanks to everyone who has supported and inspired me during last year, say thank you for your feedbacks, they were crucial for me to commit and go ahead.

I wish you Merry Christmas and Happy New Year and will stay in touch!


All Sitecore reference - mass links update

All Sitecore References project has just got a mass links update, which includes:

  • All StackOverflow questions to date
  • Blog posts I am watching
  • Reconsideration of existing links in order to achieve precise matching


And just to remind - if you have a blog and want add links from it into All Sitecore References, please use Suggest Links page to do that.


Hope you find this project helpful!



I join "The Monads" team at Sitecore Hackathon 2016! Which team do you?

I am happy to join The Monads team at this highly expected event for all of Sitecore Community on Friday January 29th, will be working together with Richard Seal and Justin L, both from USA. This is my first hackathon ever, so I am excited about the event but at the same time a bit worrying. In any case, will do the most of what I can within these 24 hours.

Are you a Sitecore developer? Why not to join the event, it will cost you nothing (except the tome, for sure) but you can get many valuable insights, meet other Sitecore enthusiasts and result having your own module at the marketplace.

You don't need to find people to create a team - just ask for joining any of existing with two people already, like I did.

To go ahead the hackathon please contact Akshay Sura - he is an organizer and will help you with that.

Best luck to all the teams and have fun!

Onero is now updated to version 1.2

Just have released a new version of Onero. So, what's new?

  • Re-worked UI - removed buttons from main screen in favour of main menu
  • Introduced Testing (settings) profiles - now settings, rules, forms etc. are individual for a profile
  • Created a base for future multiple browser supports (not only FF like now), currently on testing
  • Multiple bug fixes and minor improvements
Please update by the link: http://onero.martinmiles.net/files/Onero 1.2.zip

Looking forward to hear your feedbacks!
Cheers!

Using Onero with non-Sitecore websites - testing Transport for London website

Introduction

In this blog post I am going to demonstrate how you can test any custom website with Onero Page Runner. For our experiment I've decided to pick up Transport for London website located at http://tfl.gov.uk

  1. Creating a profile for a new website
  2. Populating Pages to process from a XML sitemap file
  3. Configuring Rules
  4. Configuring Forms
  5. Running and getting the results

1. Creating a profile for a new website

Onero configuration is based on testing profile. Using profiles it now becomes possible to create a combination of settings, rules and forms unique for for each individual profile and immediately switch between them just by selecting a profiles from a drop-down on a Settings dialog. Usually you would create a profile for one (or few) websites you would like to test with these settings. For our test we'll create a profile called Transport for London. 

Once created, the new profile immediately becomes active. You may change active profile by selecting a profile name from a drop-down as on a image below:

In fact, a profile is a folder with a profile name located on a drive, with its own combination of settings, rules and forms for submission. Changing active profile simply re-points Onero to use a folder with other settings.


2. Populating Pages to process from a XML sitemap file

On the next step we are going to load the list of pages to be tested. It can be also manually pasted into Page to process textbox, but we prefer to load links automatically from a XML sitemap file. Usually it is called sitemap.xml and is placed at the root of website. TFL website has such a file, and as soon as you specify address of that file into Load from xml sitemap textbox and hit Load Links button, Onero will process request and extract list of all the rages out of it. Sitemap file http://tfl.gov.uk/sitemap.xml references 1,374 pages and all they pre-populate the list, as per screenshot below. Also, as you may see, current profile name is displayed at реу window header.

If you hit Start button Onero will process loading all those pages, measure load timings and generate screenshots of every single page (if checked in configuration for current profile).


3. Configuring Rules

Despite is was already possible to run all the pages at the previous step, we now are going to add additional checks to ensure page is correct apart from it just loads correctly. This can be achieved through adding custom verification rules applicable to a specific (or all) pages. Clicking Rules button on the main window brings you the following dialog with all rules (for the current profile) listed.

Check-box on a screenshot below indicates whether a rule is enabled - only enabled rules are executed. [ALL] / [Incl] indicate a scope of rule execution - this is explained below.


This screenshot shows three rules and all they are enabled. The first one has [ALL] execution scope and thus will be executed on every single page; [Incl] for the second and third means that there are certain conditions that specify where exactly these rules are to be executed. Let's now create and configure these rules.

Rule in fact is a JavaScript code that returns a boolean or integer value. Rules is successful when condition clause returns boolean true or integer more than zero. For example you may return amount of elements satisfying some selector, so if more than one found - rule becomes successful. 
For websites that are run with jQuery you may benefit from writing conditions with its powerful selectors, as shown on screenshots below.

First two rules just return is amounts of element found are more than zero. The last rule return more complex combined condition, that checks if an element with specific id presents on a page and then compares the content of that element with expected message.

Please pay attention to Execution scope dropdown box - the one specifies where the rule will be executes. Three options are:
  • Everywhere - runs on every single page
  • Include - runs only on the pages from URL patterns field below
  • Exclude - runs on all the pages except those satisfying URL patterns field below
URL patterns to match store one oк multiple (comma separated) URL substrings to match. If URL has at least one of these patterns as a substring, Onero will run the rule for that page then. 

Please pay attention to a trailing '$'-dollar sign at the en of second and third patters; '$' means end of string. Thus a pattern http://tfl.gov.uk$ will match only landing page with this URL but does not match http://tfl.gov.uk/about. However, if you remove this trailing dollar sign - it will match all the pages on that domain name (because they all contain that URL pattern as a substring).
You can also delete any existing rules from that screen.


4. Configuring Forms

Similar to the rules, forms have their Forms List window, called by clicking Forms button at the main screen. It looks and functions exactly in the same manner. Double-clicking the form name opens it for edit.

Saying "forms" in his context means ability of Onero to find and populate on specific pages, submit them and analyze the results - whether form submission was successful. The last means that if form submission resulted with a confirmation message on a page - Onero is able to address that message and also check if its content matches expected. Alternatively, if form on a page redirects to a confirmation page, Onero can verify that as well and compare with expected redirect URL pattern.

Forms Editor has three logical sections: General (where to submit), Fields (what to submit) and Result match (how to verify).

URL Pattern works same as in rues - matching substring in URL will enable Onero to find and submit a form on that page.
Fields section set fields to find and populate. Field selectors have same syntax as CSS oк jQuery selectors - if it starts with # then it is ID of element, . specified class name, and omitting starting character will prompt Onero that it's an element tag name. In the last case Onero will ask you to confirm that behavior is desired, as it is less frequently used and very likely to be a mistakenly forgotten '#'or '.'


5. Running and getting the results

Onero updates the links with green / red color depending on results, as it processes them. There is also a progress-bar at the right bottom showing overall progress. 

Double clicking green or red link opens Page results for that specific URL, showing also which rules and forms have been executed on that page and their result codes. This is quite handy for cases when you see a URL turning red and would want to find out why exactly it becomes failed. The screenshots below show Page results for first three pages. You would probably notice different rules executed of each of them - that happens because of conditional URL pattern set previously at step (3).


Previewing results immediately is not the only way of inspecting results. At the end of testing process Onero generated report file with all the statistics for that test run. You may find that in reports.csv file located at Results folder within a folder with current settings profile name (Transport for London in our case). The quickest way to access this folder is to click Settings button from main screen and then Open folder button - it will open resulting folder in a separate Explorer window.

Results.csv spreadsheet contains detailed information about what pages have run and how quickly, what rules and form have been executed and their status codes. If Verbose setting is checked - all the results will be displayed (as on a screenshot below), otherwise only failed will be mentioned in that spreadsheet (that is handy as it prevents from informational noise especially on websites with thousands links and dozens of rules.


First column shows pages being executed, the second - rules and forms run on that specific pages with corresponding statuses at third column. Addons statuses column shows overall status for rules and forms executed and Page Status column shows the statuses for the page itself. They may not match, for example the page has loaded correctly and has Successful Page status, while one of its rules broke resulting Addons status to fail. Time to load shows time in milliseconds taken for page to load, rules and form are not mentioned in that figure.

I hope that quick guide managed to explain some basics of working with Onero and looking forward to your feedback!

How to use Onero with Sitecore

As mentioned earlier, Onero interacts with Sitecore via Sitecore Item Web API (I also plan to ensure the data from Sitecore Entity Service in future) and this guidance will guide through this procedure step by step. In general, there are 4 major steps:

  1. Enable Item's WebAPI
  2. Creating pages in Sitecore and forms
  3. Configuring Onero
  4. Running and getting the results


1 .Enable Item's WebAPI

Sitecore Web API requires to be explicitly enabled on your Sitecore instance. If you haven't done this yet, enable it at Sitecore.ItemWebApi.config file. You will end up having something similar to below:


        StandardSecurity
        Read
        false

In order to test if Web API works - just paste http://your.host.name/-/item/v1/ into browser and you will get a response:

{"statusCode":401,"error":{"message":"Access to site is not granted."}}

No worries about error message - it is just telling that no anonymous access allowed to you Web API endpoint, which itself is working well and just served this request. Simply changing itemwebapi.allowanonymousaccess to true will return you valid response with data.

Once you paste this list link into Onero and hit Load Links button - you have everything ready o start the test.

When you click Load Links button, Onero calls Item Web API in Sitecore instance and populates Pages to process box with preview links out of the response. At the moment only items in preview mode are available.

More information about item Web API can be found in the official documentation.


2. Creating pages in Sitecore and forms

Now let's go into Sitecore Content Editor and prepare for more complex testing. I have got a clean Sitecore 8.1 just installed instance here. I use Experience Editor to create 2 web forms on Home page (of course, WFFM for Sitecore 8 should be installed as well)

To make things even simpler, let's take two pre-existing forms coming with WFFM package and set first form to display Success Message while the second to redirect to Success Page. Also create a confirmation page located at /Home/thanks to be referenced by Success Page mode and do not forget to publish website to bring these forms and pages into web database. If everything was done correct at this step, page will look something similar to below:



3. Configuring Onero

Now we want to test forms submission to ensure they function correctly. In Onero hit Forms button, then Add New. It will open Forms Editor where you need to set fields and values to submit the form with, also find and assign submit button and finally specify the results so that Onero can verify whether the page has been submitted correctly.


Also do not forget to check. If you want to delete or modify a form - double click its name.

.


4. Running Onero and getting results
While Onero runs, it changes links in the Page to process box to green or red depending on result status:

Clicking each or already processed URL opens Page results dialog, where all the rules and forms being executed on that specific page are listed:

Double clicking a rule or form opens its editor so it is quite convenient to preview and analyze what went wrong:


At the end of testing process Onero generated report file with all the statistics for that test run. You may find that in reports.csv file located at Results folder within a folder with current settings profile name (Transport for London in our case). The quickest way to access this folder is to click Settings button from main screen and then Open folder button - it will open resulting folder in a separate Explorer window,

Results.csv spreadsheet contains detailed information about what pages have run and how quickly, what rules and form have been executed and their status codes. If Verbose setting is checked - all the results will be displayed (as on a screenshot below), otherwise only failed will be mentioned in that spreadsheet (that is handy as it prevents from informational noise especially on websites with thousands links and dozens of rules.
First column shows pages being executed, the second - rules and forms run on that specific pages with corresponding statuses at third column. Addons statuses column shows overall status for rules and forms executed and Page Status column shows the statuses for the page itself. They may not match, for example the page has loaded correctly and has Successful Page status, while one of its rules broke resulting Addons status to fail. Time to load shows time in milliseconds taken for page to load, rules and form are not mentioned in that figure.


Hope this guide was helpful enough!

Welcome Onero Page Runner - now with Sitecore support!

I have not been posting for a while but there is an easy explanation - I was busy creating Onero Page Runner, which I have finally released. Now it is able to work with Sitecore Item Web API and also became open source project on GitHub.


What is Onero and what is it best for?

Onero is the lightweight testing solution. Is ideally fits for testing websites, especially frequently updated. It is very quick and easy to start, it does not require setting up and configuring complex Selenium frameworks and is best suitable for non-developer IT professionals, like managers, testers, content authors. However developers will also benefit from its simplicity and effectiveness.

Onero doesn't just simply load pages, but also executes simple JavaScript rules against them to verify compliance. As well as Rules it can also submit forms on pages (including authorization login forms to enter protected website areas), create screenshots of every single page visited and generate detailed report at the end of its journey.


Features:

  • Automatically retrieve list of pages to test from xml sitemap file of from Sitecore Item Web API
  • Iterate and verify every single page from the list
  • Create screenshot of every page visited for future inspection
  • Visualize the process in browser as it progresses
  • Run custom JavaScript rules to add additional check for some or all pages
  • Submit forms on the page with test values and verify the result
  • Work with protected areas of websites, that require pre-authorization 
  • Store multiple settings profiles and immediately switching between them
  • Realtime status updates as it goes
  • Detailed stats on execution after test fun finished

References:


Hope you find this tool very helpful!

StackOverflow: Sitecore Development on Mac using C#

Recently came across a question on StackOverflow "Getting started developing with Sitecore CMS on a Mac using C#".

This topic is quite interesting as I am working with Sitecore entirely from my own MacBook for the past few years so I've decided to share my experience with the community.


Being a follower of Apple products I got a top spec MacBook Pro 15" and was willing to make it my primary computer that is always with me and which I can instantly open and start coding. After trying to find the best approach to run the entire Windows server ecosystem on Mac, I turned to virtualisation. The best solution I've found is Parallels Desktop and it brings me better experience than I would expect to get working on a native Windows machine. So what makes this approach so effective?

  • Virtual machine is a file / directory on a disk drive, so copying / archiving allows me to persist current state of each virtual machine with the ability quickly backup and restore.
  • Derived from pervious: I have few pre-configured VMs with Visual Studio, SQL Server, IIS and and Sitecore as well as all development tools I may require. I can immediately return to work even in case of malware preventing me from doing that.
  • Parallels Desktop has tight integration between host and virtual machines. Shared clipboard and resources, it is possible to drag-drop files between Finder and Explorer. Many other sweeties as well are available with Parallels Desktop like Coherence mode, when windows entirely "melts" into mac, with Start button in the doc.
  • Ability to run multiple virtual machine in parallel - as many as your host Ma machine's performance allow.
  • All virtual machines are connected to host mac and each other by a virtual network, so now I am able to create web farms and clusters, sometimes entirely reproducing production environment configuration. Also it is possible to run bridge to external network so virtual machines get network parameters from external DHCP server and will be able to use corporate resources like source control etc. as normal machines would do.
  • Adequate performance and immediate response combined with well thought default settings make it easy to start.
  • Full screen mode entirely simulates usual windows experience
  • Ability to run other operation systems, for example you would want to run a Linux VM with MongoDB at the same network.
The only negative point about Parallels is that it is not free, the rest pretty perfect.

I would especially recommend Parallels Desktop to those who are just beginning working with Sitecore, as their chances to break anything by mistake are high enough, so the ability to create a restore point at every single moment is very beneficial for them.