Copying variable
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Copying variable
Hi all
This is what my test is suppose to do:
Copy the object property value in the project level variable
Then use the property checkpoint to validate the above variable. However, my checkpoint failed as the variable stored at the project level is with closing brackets. Even though I have used the 'Contains' condition, it still doesn't ignore the "()" sign.
I wonder if there is a way I can get rid of "()" when the variable is originally stored ? Alternatively, is there a way I can ensure that "()" is ignored when I perform property checkpoint.
Your response is much appreciated.
Thank you.
- Labels:
-
Checkpoints
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @gdave
Is the project variable being populated by a code or keyword operation in some other test, or manually populated?
To remove characters like this I think you would need to create a small script routine to take the Project variable value and strip the brackets before it checks, like this :
def StripBrackets():
aqObject.CheckProperty(Aliases.browser.yourPage.textnode, "contentText", cmpContains, Project.Variables.valueWithBrackets.strip("()"))
Let me know if this helps or if I can provide another solution perhaps.
thanks
Mike
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
The project variable is populated by keyword operation in some other test.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can use aqString.Substring to take the middle characters only and skip the brackets at the beginning and end
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/substring.html
Marsha_R
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am using a keyword test so at what stage & where do I use tis ?
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is what I have got and somehow I am not able to make it work.
qObject.CheckProperty (Aliases.browser.pageTransact.frameMain.formOmView.panel.cell3, 'contentText', 6, ProjectSuite.Variables.TotalWithdrawalAmount_InThisInstruction, true)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it always 2 places after the decimal?
Marsha_R
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is always after 2 decimal places. Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My Var1 starts as ($100.23)
The first Set Variable Value takes the ( off Var1 and puts the result in Var3
The second Set Variable Value takes the ) off Var3 and puts it back in Var3
I would then use Var3 for the Property Checkpoint instead of the Var1
Marsha_R
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Marsha_R
However I get an invalid expression error. Not sure what's wrong with my code here......kindly advise
