cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a value to another value read from onscreen

SOLVED
Nayak_Ragh
Occasional Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: How to add a value to another value read from onscreen

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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

4 REPLIES 4
AlexKaras
Community Hero

Re: How to add a value to another value read from onscreen

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);

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Nayak_Ragh
Occasional Contributor

Re: How to add a value to another value read from onscreen

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
Community Hero

Re: How to add a value to another value read from onscreen

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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Louise562
Occasional Visitor

Re: How to add a value to another value read from onscreen

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

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors