Forum Discussion
- rraghvaniChampion Level 3
I'm not sure what technology you are using in your web application, so it's difficult to suggest anything, but have a look at Getting CSS Attributes
- rraghvaniChampion Level 3
Since you have not provided the full code, you will have to debug and step through your code to figure out the issue.
Type mismatch occurs when you assign a value to a variable that is not of its data type e.g. storing a number into a string variable.
- scottroutesmartOccasional Contributor
I would think maybe your RGB value may be looked as an array given it is 3 values separated by commas. Just a hunch, but if you are assigning that to a string then it would mismatch. Try to do an explicit conversion to a string..
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/vartostr.html
- Learner_PranaviOccasional Contributor
Thanks rraghvani , I figured out the solution.
My script goes like:
page = Sys.Browser().Page("https://something.com/something..")
style_21 = page.contentDocument.defaultView.getComputedStyle(Aliases.browser.WebPage.Cell_21 , "")
Log.Message(style_21.backgroundColor)This worked for me and I got the result as:
rgb(255,255,255)
But suddenly while running tests, I am getting Type Mismatch error.
The tests ran well previously. All of a sudden, I started getting this error.
Please help!
- rraghvaniChampion Level 3
Where is Type Mismatch occurring?
- Learner_PranaviOccasional ContributorAt line style_21 = page.contentDocument.defaultView.getComputedStyle(Aliases.browser.WebPage.Cell_21 , "")
Python Run time error, Type mismatch at this line.
- rraghvaniChampion Level 3
I don't know if the method getComputedStyle accepts alias names. You also need to check that Cell_21 actually exists too.
- Learner_PranaviOccasional ContributorYeah, Cell_21 exists. It's actually a cell in a table.
This worked fine for quite sometime. Suddenly the error began showing up.
- jkrolczyRegular Contributor
Provide some screenshot sof ObjectSpy for the cell when highlighted and not highlighted
There will be an area from the ObjectSpy to dig deeper into for what you are looking for.
I've done this for a table before.
The info is there in ObjectSpy ... just have to find the correct spot for use in the code.
Related Content
- 5 years ago
- 9 years ago
Recent Discussions
- 18 hours ago
- 18 hours ago
- 5 days ago