https://www.qatechies.com

Working With Tosca TBox Buffer Operations Modules

Concept

Tricentis Tosca : Working With Tosca TBox Buffer Operations (Set Buffer, Name to Buffer, Delete Buffer & Partial Buffer) Modules


Welcome to this Post – “Working with Tosca TBox Buffer Operations modules “. This post discusses about the Tosca TBox modules like TBox Name To Buffer, TBox Delete Buffer, TBox Set Buffer, TBox Partial Buffer, their available modules attributes and their implementation.

This discussion will also focus on some frequently asked Tosca TBox Buffer related interview questions on these modules. The complete post is divided into small sections, discussing the concepts first and then focusing on the implementation and later discuss about some frequently asked TBox interview questions. So, go ahead and enjoy reading…

Heads Up!

”      Before we start discussing the usage and implementation of Tosca TBox Buffer modules present in Tosca, I would recommend if you do not have in depth knowledge on TBox Architecture then please visit the link shared below so that you get an idea on how the TBox framework works when you use the inbuilt TBox modules in your test cases:

To Know more on Tosca TBox Architecture-Click Here


Tosca TBox Buffer Operations

The different web applications components in any project have different flows such as based on user interaction, system process, touch enabled functionality, etc. Based on the functionality of the component the values based on business requirement may change and show the new one to the user. But to validate these old values against new ones which involve some business calculations or business validation, this is usually what testers are asked to do via automation framework.

So many questions arise here depicting such situations, but main question is: “How Tosca is providing support to solve such problems”.

Tosca provides “Tosca TBox Buffer Modules” as part of their standard modules. Whenever you import the default subset you will find these modules under the folder named “TBox Buffer Operations”.

The TBox Buffer Operations folder contains the following Modules or subfolders:

  • TBox Set Buffer
  • TBox Name To Buffer
  • TBox Partial Buffer
  • TBox Delete Buffer

Before we continue on the usage and implementation, let me clear the meaning of word “Buffer”. The word ‘buffer’ in TBox Buffer means that it can store a value or dynamic expression of any type which can be used to as reference in another module for calculation or verification as the case might be.

Points to Note here is:

  1. You can store any values in buffer.
  2. Plus, any expression which might include any other buffer reference also.
  3. Also, you can verify the values stored in the buffer.

So, let’s discuss these modules one by one.


TBox Set Buffer

The TBox Set Buffer Module is the only one module that can be used to either create or verify buffer values. The word “Set” implies that either you can create a new buffer and use it later or you can reassign a value to existing buffer. Last but not least, this module allows you to verify the buffer value itself. Let’s keep it for later and we will start with the set or resetting the buffer values.

Similar to any programming language, technical automation tester frequently uses variables or constants that holds some values which might change or not depending on the requirement, on the same note-Tosca has buffers to hold the values which can act both as a variable or constant.

tosca-tbox-set-buffer-module
tosca-tbox-set-buffer-module

Creation of New Buffer

You might have following questions–

How to Set buffer in Tosca?

How to create a buffer in Tosca?

How to reuse existing buffer?

How to specify the dynamic expression in buffer?

 

Well! it’s really simple:

  1. Go to TBox Buffer Operations folder,
  2. Select the TBox Set buffer module,
  3. Drag and Drop on to your test case,
  4. Define the name of the buffer (unique name please),
  5. Now set the value which you want it to hold.

Note:

In the following shown example of TBox Set Buffer, please consider a scenario where you are having some Selenium Test Cases to run for which you require selenium path, script path, and results path. The usage and implementation is shown in blocks first and then later combined into single test case later.

For example:

Creation of New Buffer

tosca-tbox-set-buffer-module-example1-set the values
tosca-tbox-set-buffer-module-example1-set the values

Using Existing Buffer

Your next question might be – How to Set new buffer referencing some other buffer in Tosca?

Please follow below steps:

  1. Go to TBox Buffer Operations folder,
  2. Select the TBox Set buffer module,
  3. Drag and Drop on to your test case,
  4. Define the name of the buffer (unique name please),
  5. Now in the value specify it as {B[<buffername>]}, which you want it to hold or refer.

 

For example:

Using existing Buffer

tosca-tbox-set-buffer-module-example2-use_existing_buffer
tosca-tbox-set-buffer-module-example2-use_existing_buffer

 

Verifying the values in the buffer

Now comes the interesting part which tester usually ignore while working with this module and validating some requirements. Always remember that you don’t need any other module to verify the values of buffer which it holds. In fact, at any point of time post a buffer has been created you can validate the values by using the same TBox Set Buffer Module.

For example:

Verify the value of the buffer

tosca-tbox-set-buffer-module-example3-verify-buffer-value
tosca-tbox-set-buffer-module-example3-verify-buffer-value

If we run the above in scratchbook, we will get following output :

tosca-tbox-set-buffer-module-example3-verify-buffer-result
tosca-tbox-set-buffer-module-example3-verify-buffer-result

Complete example on TBox Set Buffer:

Now we will combine all the steps and use the buffers in our test case. This test case will use buffer to set the selenium path, script path and result path. Please follow the snapshot shown below:

tosca-tbox-set-buffer-module-example4-complete test case
tosca-tbox-set-buffer-module-example4-complete test case

TBox Name To Buffer

tosca-tbox-name-to-buffer-module
tosca-tbox-name-to-buffer-module

If you have questions like-

How can I find which test case just got executed?

Where can I store and retrieve the test case name? or

How can I use the test case name for later references?

Then this the module you are looking for.

This is the most often used module. This helps in identifying the test case which got executed and stores the name of that in the buffer name which you specify. Technically, this Module allows the name of the test case to be used as a buffer value.

 

Point to Note here is:

You must run this module via ExecutionList as scratchbook will not show your intended or expected result.

 

The Module contains the following ModuleAttribute:

Buffer Please specify the Name of the buffer where the TestCase name should be saved as a value.

 

For example:

If you run this test case in the execution you will see following result. The TC01 now holds the value of the test case name.

tosca-tbox-name-to-buffer-module-example1-complete test case
tosca-tbox-name-to-buffer-module-example1-complete test case

TBox Delete Buffer

tosca-tbox-delete-buffer-module
tosca-tbox-delete-buffer-module

If in the project buffers are frequently used and needs to cleaned up. This is the module you should use. This TBox Delete Buffer Module allows to remove either individual or all existing buffers.

 

Point to Note here is:

If you don’t provide any value in the Value module attribute, then you might delete all the buffers which has been set so far. So be alert while using it.

 

In multi-user environment, it happens frequently that testers do not understand the impact and clear all the buffers which exists across the system or application modules.

 

There is only one module attribute exists for this module:

 

Buffer Please specify the “Name of the buffer” to be deleted.

*****If you do not specify the value, Tosca will delete all existing buffers.

 

Example – Deleting individual buffers

tosca-tbox-delete-buffer-module-example-individual-delete
tosca-tbox-delete-buffer-module-example-individual-delete

 

Example – Deleting all buffers

tosca-tbox-delete-buffer-module-example-all-buffer-delete
tosca-tbox-delete-buffer-module-example-all-buffer-delete

TBox Partial Buffer

tosca-tbox-partial-buffer-module
tosca-tbox-partial-buffer-module

If you have situations where following questions come to your mind then this is the module you are looking for:

How can you split the value stored in the buffer?

How to verify the partial value of existing Buffer?

How can you extract a substring from the main string?

How can you extract the last part of the string?

Then this is the module you are looking for.

 

This TBox Partial Buffer Module allows to either buffer or verify parts of a value or string.

 

There are 5 module attributes, exists for this module:

Buffer Specify the Buffer name here.
Value Specify the “Value” or “string” to be Buffered or Verified.
Start This is the starting character position for buffering or verifying the value.
End This is the ending character position for buffering or verifying the value.
Last This is the last character position for buffering or verifying the value from.

 

Points to Note here:

If you are using only the “Buffer” and “Value” then this will work same as the TBox Set Buffer module.

So, do not use unnecessarily.

 

For example:

Consider we have same test case of selenium, where we have some paths to selenium jars, script jars etc. Now we want to extract the main folder out of this path. In this case we directly specify the characters for starting and ending till which, we want the substring to be extracted and to be stored in the buffer.

 

tosca-tbox-partial-buffer-module-exmaple-extract-path
tosca-tbox-partial-buffer-module-exmaple-extract-path

 

Conclusion:

Well! all these TBox Buffer Operations modules are pretty decent in working and helps in achieving the goals pretty fast. Still if you feel some other functionality would have been provided and could have helped you in solving your problem, then I would recommend that you follow below post to create your own TBox XModule and extend the functionality the way you want,

 

Follow Here ==> How to create your own custom control in Tosca?

 

Isn’t this sound interesting? No problem.

If you are interested in finding other way around for splitting the values or string or extracting the string based on some regex patterns and so on, then please follow my course on Udemy, where you will find the I have discussed on splitting the values stored in buffer using loops etc. to arrive at a perfect solution. Plus, you can follow the same video to learn how to reuse it in your test cases. If this makes you feel motivated enough to you can me then please follow the course link with coupon applied:

If you find this interesting and wanna start now you can follow the link shared below:

Tricentis Tosca : Working with Excel Engine (coupon TOSCAXL15)

this link includes a discount and you can buy this for only 15$.

You can also watch the introduction video of the course here:

Tricentis Tosca : Working with Excel Engine (coupon TOSCAXL15)

 

Few questions for you to cogitate on analyzing the problem statement and try arriving at the solution:

 

  1. Can tester use the TBox Buffer modules across the test cases?
  2. Can tester refer the Buffer value directly across the full test suite?
  3. Can Partial Buffer Module help in splitting the string with regular expression?
  4. How frequent should tester use the TBox Buffer operations modules?
  5. Can you build your own custom control on top of the default functionality given by Buffer modules?
  6. Can buffer modules evaluate the dynamic expressions?

 

Well, this brings me to the end of the discussion “Working with Tosca TBox Buffer operations modules ” where we have discussed some concepts as well as some interview questions.

 

I really hope you enjoyed reading the post. If you have any doubt on this please feel free to add your comment below.

And if you like to read more on TOSCA Interview Questions please follow below links:

Tosca Interview Questions – Part 1

Tosca Interview Questions – Part 2

Tosca Interview Questions – Part 3

Tosca Interview Questions – Part 4


If you would like to keep track of further articles on TOSCA, I recommend you to SUBSCRIBE by Email and have new articles sent directly to your inbox.

4 Replies to “Working With Tosca TBox Buffer Operations Modules”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

advanced-floating-content-close-btn
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5034726663464946 (adsbygoogle = window.adsbygoogle || []).push({});
advanced-floating-content-close-btn 
*************************** Do you want to learn TOSCA? Do you want to excel in Career? Try my New Courses: 1. Tricentis Tosca and Working with Excel   2. Tricentis Tosca and UI Automation Great News!!   Price has been slashed down for limited period of time.So Hurry!!! Click The Shown Links and Enjoy Learning. ***************************
 
error: Content is protected !!