how to compare same number in robot framework

687 views
Skip to first unread message

rahul shinde

unread,
Dec 20, 2022, 2:52:10 PM12/20/22
to robotframework-users
hi 
i am new in robot framework 
 I want to compare two number so first I have fetch two value from from UI after that
 i want compare both the value so
 ${count1}= Set Variable ${xyz} 
${count2}= Set Variable ${abc}
 ${Count3}= Set Variable ${$count1}+${count2}}        # o/p=(“1234”) 
${count4} = Replace String ${count3} ${EMPTY} ${EMPTY} 
${count5} = Convert to string ${count4}
 ${count6}= Get Text ${loc_count} # o/p= data (1234)
 ${Count7} = Remove String ${login} data 
${Count8} = Convert to string ${count7}
 Log To Console ${count7} 
Should Be Equal ${count5} ${count8}
 so in console I have get (1234) != (1234)
 I dont know why these happen instead of that I have also try for convert to string i have convert to number but that time it showed 1234 can not convert into floating point number :value error could nt convert string to float code if i try to convert the string to number ${count3} = Convert To Number ${_count2

Nkina Ramonyai

unread,
Dec 21, 2022, 2:14:33 AM12/21/22
to shindee...@gmail.com, robotframework-users
Hi Rahul

Rather convert both to Strings only

${FundTotalValue}=        Convert to String          ${FundTotalValue}

Also try running your command like this:
Run Keyword And Continue On Failure   Should Be Equal As Strings    ${fund1CurrentMarketValue}      ${FundValue1}

Hope this helps, you can shout if you need help!

Kind regards
Nkina
 
 




--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/5dd65d02-d7f8-4be5-8088-a49442200594n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages