Ask a Question

Are there any characters that can cause Compare Properties to fail?

SOLVED
csteinburg
Occasional Contributor

Are there any characters that can cause Compare Properties to fail?

I am using the String 


THEquickbrownfoxjumpedoverthelazydog!@#$%^&*()_+1234567890-=-\|,./<>?;':"[]{}'`

and TestComplete consistently reports on Compare Properties that my field does not contain this substring, even though it prints it back to me exactly the same

Are there any characters that perhaps Compare Properties does not like? If I enter less special characters like 
THEquickbrownfoxjumpedoverthelazydog@#% then it usually works but I am afraid there are 1 or more characters that consistently causes this check to fail. Is it perhaps also the order of the characters?

2 REPLIES 2
Marsha_R
Community Hero

Slashes and quotes can be taken as control characters in coding sometimes, not just in TC.  

 

I would try adding aqConvert.VarToStr to both the values being compared just to force them each into being a string and see if that helps.

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/vartostr.html

 

You can also try using two slashes and two quotes or double quotes in each spot where you have one.  Two in a row can sometimes convey "I am a string" instead of "I am a control character".


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
sonya_m
SmartBear Alumni (Retired)

Thanks a lot, Marsha!

 

Hi @csteinburg , does this answer your question?


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: