Forum Discussion

handanu's avatar
handanu
Contributor
5 years ago

How to store textbox value

Hi,

I want to copy a value (from textbox which is readonly and couldn't be copied with mouse or keyboard) and paste to another textbox on the second tab.

How do I achieve that?

 

Thanks in advance

  • hkim5's avatar
    hkim5
    5 years ago

    drag and drop the set variable operation into your keyword test workspace, create a new variable, select object property, and select the object property of the desired object

    then use either call object method or on screen action operation in order to select the textbox to input into, then use the keys or settext operation, then refer to the variable created above as the input value

  • that textbox may have a property which contains the text value that you are looking for.

    save that property to a str variable -> navigate to that second tab second textbox you want to input into

    use settext or keys method to input the str variable that we initially stored into the second textbox.

     

    def test1():
    str_variable = Alias.myTextbox1.contentText 
    #perform some steps here to get to your second tab, etc
    Alias.myTextbox2.SetText(str_variable)
    • handanu's avatar
      handanu
      Contributor

      Thank you for you answer but how do I do it in keyword test?

      • hkim5's avatar
        hkim5
        Staff

        drag and drop the set variable operation into your keyword test workspace, create a new variable, select object property, and select the object property of the desired object

        then use either call object method or on screen action operation in order to select the textbox to input into, then use the keys or settext operation, then refer to the variable created above as the input value