Ask a Question

mathematical operations with variables in KeywordTesting

SOLVED
SK2020
Occasional Contributor

mathematical operations with variables in KeywordTesting

Hi,

In my project I need to subtract two values to compare with another value.

My problem is how to subtract two values (or add, or any other simple mathematic function)

I have created two variables which store my values. And I need make an addition or subtraction and need to create a new variable for the result. After that I will compare the result with another variable for verification.

Which method or operation should I use? (I'm creating test cases with keyword tests)

Please can you help me on this issue.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Marsha_R
Community Hero

Re: mathematical operations with variables in KeywordTesting

Use Set Variable Value (lots of screenshots to follow)

 

first pick your result variable out of the list

 

Marsha_R_0-1608828515163.png

 

then Next and choose Code Expression, then select your first variable, enter a +, then select your second variable

 

Marsha_R_1-1608828655829.png

 

You will end up with this

Marsha_R_2-1608828764558.png

 

Click OK and then Finish and you will see this in your test

 

Marsha_R_3-1608828818185.png

 

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

3 REPLIES 3
Marsha_R
Community Hero

Re: mathematical operations with variables in KeywordTesting

Use Set Variable Value (lots of screenshots to follow)

 

first pick your result variable out of the list

 

Marsha_R_0-1608828515163.png

 

then Next and choose Code Expression, then select your first variable, enter a +, then select your second variable

 

Marsha_R_1-1608828655829.png

 

You will end up with this

Marsha_R_2-1608828764558.png

 

Click OK and then Finish and you will see this in your test

 

Marsha_R_3-1608828818185.png

 

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

Mathernee
Occasional Visitor

Re: mathematical operations with variables in KeywordTesting

An algebraic expression is a collection of numbers, variablesoperations, and grouping symbols. You will translate an unknown number as the variable x or n. 

The grouping symbols are usually a set of parentheses, but they can also be sets of brackets or braces.

In translating expressions, you want to be well acquainted with basic keywords that translate into mathematical operations: addition keywords, subtraction keywords, multiplication keywords, and division keywords .

 

 

 

 

iMessage for PC

SK2020
Occasional Contributor

Re: mathematical operations with variables in KeywordTesting

Thank you for your help. It works

 

cancel
Showing results for 
Search instead for 
Did you mean: