variable values and the test case structure
Posted: 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
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