Forum Discussion

HaniJoudeh's avatar
HaniJoudeh
Frequent Visitor
5 years ago
Solved

Compare data retrieved from excel (Num only) with UI (Num+Unit)

I am trying to compare data between UI and data retrieved from excel The data in excel is number only (40) and it displayed in the UI as number and unit (40 kg), how can I test it  
  • tristaanogre's avatar
    5 years ago

    Is the unit always going to be the same?   If so, it's pretty easy.

     

    This is pseudocode... not tested, not runable as is, presented here as concept.

     

    var valueFromExcel
    
    valueFromExcel = "40"
    
    if Aliases.myApp.myField.wText = valueFromExcel + " kg" then
        Log.Message("Looks good")
    else
        Log.Message("whoops, we have a problem")