Calculation between two variables by contribution equal to one variable

Hello,

I have a problem. I can’t seem to calculate two variables in subtraction which must be equal to either a varial or an object.

Franchise1 = WebUI.getText(findTestObject(‘Object Repository/SAMI_TNR_RECETTE/Page_Cration dun dossier dindemnisation/dd_96,00’)).replace(’,00 €’, ‘’)

Règlement = WebUI.getText(findTestObject(‘Object Repository/SAMI_TNR_RECETTE/Page_Cration dun dossier dindemnisation/dd_550,00’)).replace(’,00 €’, ‘’)

Total1 = WebUI.getText(findTestObject(‘SAMI_TNR_RECETTE/Page_Cration dun dossier dindemnisation/dd_454,00’)).replace(’,00 €’, ‘’)

Total2 = WebUI.getText(findTestObject(‘SAMI_TNR_RECETTE/Page_Cration dun dossier dindemnisation/span_454,00’)).replace(’,00 €’, ‘’)

Total = ("Règlement - Franchise1 = "+Total1)
assert Total.equals(Total1)
assert Total.equals(Total2)

Do you have a solution to my problem? Because I am blocked.
Thanks

If I understand you correctly, you are trying to perform mathematical operations on text strings. That is not possible, because…

"alexis" + "russ"  gives ==> "alexisruss"

And this:

"alexis" - "russ"  is meaningless

So this:

"Règlement - Franchise1 = " + Something

is not likely to be what you’re trying to achieve.

There are ways to convert “strings of characters” to numeric values:

n = "5" as Integer  // converts the string "5" to the number 5

So try something like this:

int Total1 = WebUI.getText(...) as Integer
int Total2 = WebUI.getText(...) as Integer
// etc ...
1 Like