Tag Archives: testing

You need to learn Automation? Start here!

27 Apr

Like anything, it takes a while to get good at anything (…unless your name is Messi)messi

I have been writing and blogging now for some ten years on various sites, this site being the latest one and I find, the more I write, the easier it is to write.

images

On writing, I find you need to be willing to write a lot of stuff you wont end up using, to get to the stuff you will. a writer might start on short stories, get more confident, develop their voice and maybe get published.

One Hollywood writer interview I saw once said you need to be prepared to write ten scripts that get rejected to get a success.

Source: Life lessons from Benjamin Franklin

“Do not fear mistakes. You will know failure. Continue to reach out.”
Success comes from doing things “right,” and doing things right is usually the result of first doing things wrong.

You are certain to make mistakes; the path to success is lined with mistakes and failures, just keep moving. Successful people make a lot of mistakes, but they don’t quit, they keep moving until they arrive to their goal.

“Either write something worth reading or do something worth writing.”

If you want to get better at something, you need to practice until it becomes automatic and it’s surprising how much you learn, especially when you think your not learning anything?

learn

This year I have been learning Java with a view to furthering my testing career, but of course nothing is anything by its self, everything connects and I have made a list of subjects to cover, while you are tired looking at the code

To Automate tests, you need to understand the following:

 

And of course, if you see a new acronym, software tool in a job description, I would google that and look it up on one of the many YouTube channels and learn as much as possible and add it to your bag…

bag

Advertisements

Selenium XML Data driven testing… sounds harder than it is.

15 Sep

Selenium is a tool which every tester is using because it is:

  • Open Source
  • Runs multiple tests at a time
  • Supports all browsers like IE, Firefox, Mozilla, Safari
  • Supports all programming languages Ruby,C#, Java and Python.
  • Supports all Operating Systems

Data driven testing means we can run the same test multiple times with different data from an external data XML file instead of using the same hard-coded values each time the test runs

Selenium IDE is a Firefox plugin to record the users use of the browser for testing purposes, by installing the browser extension Sel Blocks, we are able to do Data driven tests

A – To install Selenium IDE
1, Download the latest Selenium IDE version
2, Install the Add-on
3, Restart Firefox
4, From the Firefox application, select Tools then Select Selenium-IDE

Next to do XML data driven testing we need to install SelBlocks

B – To Install SelBlocks
1, Download the latest Selenium SelBlocks version.
2, Install the Add-on
3, Restart Firefox
4, From the Firefox application, select Tools then Select Selenium-IDE

To Do XML Data driven testing, we need to create an XML file, a file with one record would look a bit like this

Example 1:
<testdata>
<vars Email=”Make_This_Unique@gmail.com” firstname=”First1″ lastname=”LastName1″ password=”123456″ rpassword=”12345″ npassword=”12345cc”/>
</testdata>

Parameterised data source:

Parameter_Data_Source

C – Create the directory: ’01 Selenium’ on the C drive of your computer

D – Save the following files to the directory called ‘C:\01 Selenium’ on your computer

A, Test.xml
B, Create_Account.HTML

Please Note:

Each time you run this test, you must edit and update the Test.xml file with a unique email address for your test run

Parameterised data displayed in the Selenium IDE

Parameter_DataXE – To run the script:

1, Launch Firefox

2, Launch Selenium IDE

3, Open the Test Case ‘Create_Account’ in ‘C:\01 Selenium’

4, Run the Test Case ‘Create_Account’

Whats happening when you run this?
1, The script is creating an account for every entry in the XML file for a demo shopping site

2, ‘forXml’ command in the script is used to set the target of the XML file’s path. The script ends by adding ‘endForXml’, both these command are provided from the SelBlock Add-on.

3, The variable in test data file is caled by using ‘${VARIABLE}’ in the syntax.

4, When this test is executed, Sel Blocks loads the content of XML file in memory and executes the script for number of times <vars> element present in the XML file.

5, In this example it will execute the test twice. Once you see it working, it is easy to copy and paste more data to be created

6, For all the attributes mentioned in <vars> element, Sel Blocks create internal variables that we can substitute as Selenium command parameters.

Selenium Log:

Selenium log

F – To do:
1, Analyze the Selenium IDE Log tab for the results.
2, If the expected data and actual data do not match, an error is reported in the Selenium IDE Log tab.

I hope this helps some people get started with some data driven tests, until the next time

%d bloggers like this: