Forum Discussion

MrDysprosium's avatar
MrDysprosium
Contributor
9 years ago
Solved

Comparing a value against what is in the clipboard?

Using a Property Checkpoint, is there a way to compare a value against what is currently in your Windows Clipboard? For instance, I want to make sure that a value that I copied out of a now closed window matches that of a field from another window. These windows cannot be open at the same time.

  • ,

     

    You can do something like below,

     

    function testChecpoint()

    {

     

    var currentCilpboardTxt = Sys.clipboardtext;

     

    If(yourObject.wText == currentCilpboardTxt)

    {

    Log.Checkpoint("Passed");

    }

    else

    {

    Log.Error("Failed")

    }

    }

2 Replies

  • Why not simply save the value from the old window into a Project Variable, and then use the Checkpoint to verify the value from the new window against the variable?

     

  • shankar_r's avatar
    shankar_r
    Community Hero

    ,

     

    You can do something like below,

     

    function testChecpoint()

    {

     

    var currentCilpboardTxt = Sys.clipboardtext;

     

    If(yourObject.wText == currentCilpboardTxt)

    {

    Log.Checkpoint("Passed");

    }

    else

    {

    Log.Error("Failed")

    }

    }