Forum Discussion

mima_vasiljevic's avatar
mima_vasiljevic
Occasional Contributor
9 years ago

Saving a value from Text Box

Hi, I have a WPF app which needs to be automated somehow :) I'm pretty much novice user of TestComplete, and especially in WPF.

So, here's my problem:

I have one readOnly textBox1, with value that changes.
I also have one more ReadOnly textbox with value which is also value that changes.

How can I save both of those values (separated ofc) so I could use them later.

[what i want to create after - save that value from TextBox1 as value1, on TextBox2 save another value as value2, and after that substract value1 and value2. That result compare with some TextBox3 etc... ]

Help :)

 

2 Replies

  • Hi,

     

    You can do this by storing the value of the text box, in a variable. Please review the following video which will provide some further information on the steps done to achieve this

     

    http://screencast.com/t/rCni84XUJx

     

    I hope this helps

     

    Regards

    Damien Walsh

     

    Technical Sales Engineer

    • mima_vasiljevic's avatar
      mima_vasiljevic
      Occasional Contributor

      Hi Damien and thank you so much for the tip!

      What you suggested could work if I would use that hardcoded string(if I understanded it correctly), but, in previous steps of my case, I have some script which generates random number and set it in that Textbox field.
      So, every time I start new test new value will be available... (after that I close edit form I have textBox as readOnly field)
      Any hints how could I save that in variable?
      Could I use some Code Expression perhaps?

      Thankx again!