Forum Discussion

Nayak_Ragh's avatar
Nayak_Ragh
Occasional Contributor
4 years ago
Solved

How to add a value to another value read from onscreen

I have an object value (Quantity) and I need to increment it by 10.

I used 'Set variable value' method to read the onscreen object value to a variable. but I am not able to increment it with a desired value and make an entry on screen.

Requesting your help to resolve this issue.

  • AlexKaras's avatar
    AlexKaras
    4 years ago

    Hi,

     

    > if there are any special methods to be used to write the script output into the field?

    .Keys() method for scripting.

    Use On-Screen Action operation for Keyword test and configure it to call Keys method.

     

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Without knowing anything about your tested application and control you are working with, I may suggest something like this:

    var aValue = obj.Quantity.Value;

    aValue = aqConvert.VarToStr(aqConvert.varToInt(iValue) + 10);

    obj.Quantity.Keys(aValue);

     

    • Nayak_Ragh's avatar
      Nayak_Ragh
      Occasional Contributor

      Thank you for the solution. I did work to a great extent and I have captured the value from the application, converted to Int and added another value 10 to it.

      Log message display is working fine.

      However, I am not able to write this value into the field in the application.

       

      Note: Mine is a Keyword testing approach.

      Could you please advise if there are any special methods to be used to write the script output into the field?

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > if there are any special methods to be used to write the script output into the field?

        .Keys() method for scripting.

        Use On-Screen Action operation for Keyword test and configure it to call Keys method.

         

  • Louise562's avatar
    Louise562
    Occasional Visitor

    Express gratitude toward, I want to do it, yet it requires some serious energy, thank you for sharing valuable data. Thanks for the info i will try to figure it out for more

    • jenniferduran's avatar
      jenniferduran
      New Member

      Nice Post !! I like it, it also comprises a lot of useful facts. Advantageously, this is really the best on this notable topic. I harmonize with your conclusions and will thirstily look forward to your approaching updates. In my opinion, this post is really the great one! Thank you for this post, I am mainly surprised by the way your content is unique and almost every single little detail. we can do the manipulations for the screen fields by keeping loop at the screen.

      ex.:

      Loop at SCREEN.

      endloop.

      and to do manipulations based on the field name we can use "screen-field."

      ex:

      loop at SCREEN.

      if screen-field = kna1-kunnr

      " the required code"

      endif.

      endloop.