variable values and the test case structure

Ask general questions here.
martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

variable values and the test case structure

Post by martinsw » Mon Aug 20, 2012 10:06 am

Background:

My AUT is a barcode scanning web application. The application consists of a "scan" feature, which enables the user to scan the relevant barcode, and a "search" feature. The search feature enables the user to enter the barcode of the scanned item and confirms the time at which the item was scanned.

What i want my automation to do is scan a batch of barcodes and then use the search feature to validate the recording of the scan event. All scanning events must take place first before any barcodes can be searched for. In other words, events need to happen in

the following order:

(1) Scan barcode 1 using scan feature
(2) Scan barcode 2 using scan feature
(3) Scan barcode 3 using scan feature
(4) Navigate to search page
(5) Search for barcode 1 by entering barcode 1 into search feature
(6) Validate scan event
(7) Search for barcode 2 by entering barcode 2 into search feature
(8) Validate scan event
(9) Search for barcode 3 by entering barcode 3 into search feature
(10)Validate scan event

The barcode value is data driven from an external data source (excel file). All barcodes that are scanned need to be unique. In order to ensure that all barcodes are unique, I have a formula in the excel file which generates the barcodes based on the current date and time (dd-mmm-hhmmss).

My problem:

In order to ensure that barcodes are scanned successively (in the manner outlined above), I created a "scan" test case with a data source containing 3 row with each row containing a unique barcode. When the test case executes, due to its data source having 3 rows, it iterates three times and three different barcodes are scanned one after the other - this is all good!

However, when it comes to performing the search for each barcode I encounter problems. The three barcode values, associated with the three scan events, end up being local to the "scan" test. Therefore, when it comes to performing the search, I don't know how to access the exact barcode values as they were in that test case. I don't see how making the data souce "more global" (i.e. by moving it higher up the test case structure within my automation) would work as then then it wouldn't be simply the scanning of the barcode that would iterate three times but the whole test structure associated with the data source! Is there perhaps a way of passing variable values up from a child test case to its parent? This would perhaps be one solution to the problem if it was possible to do this?

Do you understand my problem or do i need to provide further information?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: variable values and the test case structure

Post by Support Team » Mon Aug 20, 2012 3:48 pm

Hi Martin,

The problem is that you couldn't use the ExcelConnector twice because the values would be different the second time, or do you didn't know that you can use one ExcelConnector in different test cases?

Regards,
Markus
Ranorex Support Team
.
Image

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: variable values and the test case structure

Post by zator » Tue Aug 21, 2012 9:34 am

Hi,

Well, in my opinion you should reorganise your tests. If your task is to scan 3 barcodes and then validate them there is no reason to scan each one in iteration. You rather should scan 3 of them in ONE test.
Then if you want to make your tests data-driven the connector should contain 3 columns for EACH test.

It is my opinion but i am not sure i understand you well :)

Paweł

martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

Re: variable values and the test case structure

Post by martinsw » Tue Aug 21, 2012 2:57 pm

Hi Markus,

I'm not sure I understand your reply so i will send you a copy of my automation to better illustrate the problem. I can think of a solution but it involves restructuring my test cases and data input file. I would rather not do this if a quicker fix is available.

I will email Ranorex support once I have my solution prepared and uploaded to your server.

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: variable values and the test case structure

Post by Support Team » Wed Aug 22, 2012 9:05 am

Hi Martin,

I just wanted to ask if you know that you can use the data connector in the other test cases too?

Regards,
Markus
Ranorex Support Team
.
Image