How can I assert if a value is equal to another
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I assert if a value is equal to another
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If sString1 = sString1 then
Log.Checkpoint "The strings are equal","" ,,,Sys.Desktop.Picture()
end if
Is that what you meant?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CheckEquals( displayeRetailerId, expectedRetailerID, "retailerID" );
function CheckEquals(aValue1, aValue2, aDescription) {
// Log.Message ("one: "+aValue1 + " two: "+ aValue2);
if (aValue1 != aValue2) {
Log.Error(aDescription + " '" + aValue1 + "' does NOT match value '" + aValue2+"'");
Log.Message("string 1 in additional info.", aValue1);
}
else {
Log.Checkpoint(aDescription + " '" + aValue1 + " matches value '"+ aValue2+ "'");
}
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where to write this code?
Also in my desktop application, the error message is displayed in a tooltip when I hover over an exclamation mark icon.
I need to read that tooltip message and then log to an external file that the test has passed
How to do this?
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're asking a lot of information in a simple question, @mcp111. 🙂
So... to start with, the code is written in a Script unit. Read the following for writing script tests in TestComplete.
https://support.smartbear.com/testcomplete/docs/scripting/overview.html
As for the tooltip, I would use Object Spy to determine how the tool tip shows up. Sometimes the tooltip is its own object... sometimes it's a property of the object that has the tool tip assigned. So, you will need to first need to determine where the tool tip is. From that point, it's either code a HoverMouse action over the exclamation mark icon and do a property checkpoint on the tool tip object... OR, do a property checkpoint on the exclamation mark icon for the tool-tip property...
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to do everything in TestComplete itself.
How would I access tooltip text in TestComplete?
How to log a message that the test passed to an external log file?
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@mcp111 wrote:
I need to do everything in TestComplete itself.
How would I access tooltip text in TestComplete?
How to log a message that the test passed to an external log file?
And my answer all involves TestComplete. Script units are part of TestComplete. so, if you want to write that code, you need to write script code in a script unit and then use "Run Script Routine" operation in your keyword test to execute. Object Spy is part of TestComplete. Property checkpoints are part of TestComplete.
So... I'm not sure what you're looking for.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok
When I googled Object Spy it showed QTP Object Spy so that's why I was confused.
When I looked in more detail I found that there was also a Testcomplete object spy.
I think I got what I need.
Thanks
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rather than a simple google search, start with
https://support.smartbear.com/testcomplete/docs/
That's ALL the TestComplete documentation in one place. It's searchable... and it mirrors the Help that's built into the TestComplete tool... it also has built in tutorials, code examples, etc.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I do a property checkpoint on the exclamation mark, I don't see any tooltip property. So how to compare the tooltip text?
And if the text is correct then how to log that the text has passed?
Partha Mandayam
Software Consultant
