Hi!
I'm trying to use the regular expression option when searching for something. Windows, control, etc... But it never workes.. I tried the following:
form = Application.FindFormTitle(Consts.GetString("TitleQueryNumber"), SearchMatchMode.MatchRegExp, true, 25000);
Where Consts.GetString("TitleQueryNumber") inputs : 'Query [1-9] -'
( yes i tried entering it as a string and not using variables. )
This should find this window:
Query 2 - IHS Enerdeq™ Desktop Canadian
But it does not...
Any suggestions?
Thanks,
Gergely.
Regex in findSomething
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
I think you misunderstood me. From the code you submitted I can see that you are using Ranorex 1.X. I wanted you to check that you are using the right DLLs.
You need to use the DLLs from "Net2.0-Pro" folder in the Ranorex 1.X installation folder (usually "C:\Program Files\Ranorex 1.5.1\Bin\Net2.0-Pro"). Please make sure that the RanorexCore.dll you are using stems from this folder!
Regards,
Alex
Ranorex Support Team
You need to use the DLLs from "Net2.0-Pro" folder in the Ranorex 1.X installation folder (usually "C:\Program Files\Ranorex 1.5.1\Bin\Net2.0-Pro"). Please make sure that the RanorexCore.dll you are using stems from this folder!
Regards,
Alex
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
I can only guess. The RanorexCore.dll was copied into the project after the project was created, so i can only guess that it was the same... But i could try to overwrite it?
The problem is that i can't use regular expressions. If i write in the whole name without regex than it can indeed find it. But that's not what i need...
What i need would be [1-9] because there can be any number from 1-9.
Thanks,
Gergely.
The problem is that i can't use regular expressions. If i write in the whole name without regex than it can indeed find it. But that's not what i need...
What i need would be [1-9] because there can be any number from 1-9.
Thanks,
Gergely.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
If searching for the whole name with SearchMatchMode.MatchRegExp worked, then you should have the right RanorexCore.dll. Otherwise, please overwrite the RanorexCore.dll from the Ranorex installation directory.
I tried Application.FindFormTitle with a similar RegEx and everything worked just as expected. Maybe the "TM" characters in the title are the problem. What is the exact title of the application in RanorexSpy?
Regards,
Alex
Ranorex Support Team
I tried Application.FindFormTitle with a similar RegEx and everything worked just as expected. Maybe the "TM" characters in the title are the problem. What is the exact title of the application in RanorexSpy?
Regards,
Alex
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Yeah, and that way they do work, but i need a number to be there :S
I'm trying to use 2.0 now, but the problem is that ...
do i really need to use the Whole Xpath??
EDIT: Disregard this.. i found that */button works fine..
Exp:
but i only need /button[@accessiblename='Query'] and i'm searching in the Data Tools control. But if i don't use the full xpath it does not find it.. I could use descendant but that's not the point..
EDIT: This is however still an issue.. This is should work or not? As i remember xpath allowed the use of regex in the values too..
And also.. I'm trying Regex here too... Like:
form = "form[@title='IHS Enerdeq']";
or
form = "form[@title='IHS Enerdeq*']";
But that does not find IHS Enerdeq™ Desktop Canadian too
I'm trying to use 2.0 now, but the problem is that ...
do i really need to use the Whole Xpath??
EDIT: Disregard this.. i found that */button works fine..
Exp:
Code: Select all
/form[@controlname='CoreForm']/element[@controlname='barDockControlTop']/element[@controlname='Data Tools']/*/button[@accessiblename='Query']
EDIT: This is however still an issue.. This is should work or not? As i remember xpath allowed the use of regex in the values too..
And also.. I'm trying Regex here too... Like:
form = "form[@title='IHS Enerdeq']";
or
form = "form[@title='IHS Enerdeq*']";
But that does not find IHS Enerdeq™ Desktop Canadian too

- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
For regular expressions in path attributes please use the "~" operator:
Regards,
Alex
Ranorex Support Team
Code: Select all
form = "form[@title~'IHS Enerdeq']";
Alex
Ranorex Support Team