Forum Discussion
- Hassan_BallanFrequent Contributor
Hello,
As you are using Excel for the "data table variable"?
If so, Excel sometimes would change the cell type from string to Boolean once you add "True" value.In order to avoid such data type issues, after you fix your variables type I would suggest you use Yes/No rather than True/False.
- Wyatt7989Occasional Contributor
it's a Table Variable.
What I was hoping to be able to achieve is essentiallyLogin as user#1
Check the user can see what they're supposed to be able to see (Exists = TRUE)
Check the user cannot see what they're not supposed to be able to see (Exists = FALSE)
Login as user#2
etc...
There doesn't seem to be a way to change the data type in the cells of the table variable itself?
- rraghvaniChampion Level 3
Refer to https://support.smartbear.com/testcomplete/docs/testing-with/variables/data-types/table.html
Here's an example in JavaScript code, where I use the method toString() to convert the value into a string value, which can then be used in the Compare method to compare two strings.
This approach can solve your issue, but ideally, you need to ensure your data is correctly defined.
- JDR2500Frequent Contributor
I agree with the other feedback regarding the mismatched data types being responsible for your trouble. You should be comparing Boolean values with cmpEquals rather than cmpContains.
Something else to keep in mind it "Exists" and "Visible" are not the same thing. To an end user they are effectively the same because either they do, or they don't, see something.
However, from a development/implementation perspective UI elements can exist, but be hidden. In that case you need to make sure you're checking the right property or else you won't get the results you're expecting. I've made the mistake of checking for exists when what I really wanted was "Visible" or "VisibleOnScreen".
Last but not least, checking if something exists can cause a performance hit equal to you auto-wait setting in any case where it doesn't exist. TestComplete always waits the full amount of time set in the auto-wait when checking if something exists. You may want to adjust the wait period down in some cases using a custom timeout.
Here is the relevant help topic: Specifying Custom Timeouts For Operations | TestComplete DocumentationFor instance, is waiting two seconds long enough to verify whether it exists or not? If so, setting the custom timeout will improve your test performance.
- rraghvaniChampion Level 3
Can you provide a screenshot of your property checkpoint and the condition? Also, what are you comparing it to, what's the actual value?
Your data type mismatch could be relating to the conditional expression, is "True" equal to True? I.e. comparing a string value with a boolean value.
- Wyatt7989Occasional Contributor
Hi rraghvani and thanks for your assistance.
Update the property checkpoint gives me an error stating "Unable to update the property checkpoint"
- rraghvaniChampion Level 3
As suspected, you are comparing a string value ("true") with a boolean value (true).
The property value of Exists is either true or false. You need to look at your project variable type, and ensure it's defined as boolean
Related Content
Recent Discussions
- 2 hours ago
- 6 days ago
- 10 days ago