How To use "Find" Method with multipe properties and values in connected application (C# Code)
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How To use "Find" Method with multipe properties and values in connected application (C# Code)
Hi,
I am able to pass single property and value, how to pass multiple properties and values to identify the object?
C# arrays are not supported
Something like this is also not working:
var propNames = "text,Enabled";
var propValues = "Simulate,True";
...["Find"](propNames, propValues, 100, false);
How can I pass array as a parameter?
Thanks!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try something like this.
propNames = new Array ("text","Enabled");
Thanks,
Carson
Click the Accept as Solution button if my answer has helped
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not working, it's not like JScript/C# Script or something like that.
'Array' in C# is an abstract class
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'PropNames' and 'PropValues' should be of 'var' type.
When I'm looking at the TestComplete's 'var' type declaration, I can see the supported types 'var' can get in his c'tor.
There aren't any arrays there.
Is it impossible to use multiple names & values when writing connected app in C#?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use multi-part searches in C# Script.
var typeARR = Array("VCLClass", "Caption");
var valueARR = Array("class_name", "caption_text");
var do_search = panel_object["FindAllChildren"](typeARR, valueARR, 3, true);
Works fine for me.
Not embedded within a C# application though. Just run as a scripted test within TestComplete. Not sure about it if it's embedded in the application ...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Yes, this will work for C#Script from TestComplete, but not for pure C# from the Connected Application. And this is what was requested in the initial thread message.
@Ivg, if no solution was found yet, I would recommend to ask Support directly via the http://support.smartbear.com/message/?prod=TestComplete form.
/Alex [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
Ah right.
Wasn't quite sure.
In which case, is this:
http://community.smartbear.com/t5/Getting-Started-with/FindAllChildren/td-p/94331
Any help? It has a reply using FindAllChildren with multiple properties/values in C#. Although, there is no reply to say if it worked or not?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting...
Thank you a lot, Colin, for the link!
Can't check at the moment if the referenced code can be built (at least), so any comment from @Ivg is appreciated.
/Alex [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
Colin, thanks for the link!
It helped.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem.
