Environment:Win7 US,Ranorex2.1
Application: DxDiag.exe
I don't see any introduction for this kind of usage of Ranorex.Form.
i use it in my project like this ,but it failed:
// click display tab
Ranorex.Text t="/form[@title='DirectX Diagnostic Tool']/container/text[@controlid='5008']"
RegularStr="No problems found.*";
...
if (Regex.IsMatch(t.TextValue,RegularStr,RegexOptions.IgnoreCase)
{
}
//click sound tab
if (Regex.IsMatch(t.TextValue,RegularStr,RegexOptions.IgnoreCase)
{
}
//click input tab
if (Regex.IsMatch(t.TextValue,RegularStr,RegexOptions.IgnoreCase)
{
}
i find the match always fail. Did i miss some steps???
If use Host.Local.FindSingle or Find<T>(..,..) ,it works well
Ranorex.Form="xxxxxxxx"
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex.Form="xxxxxxxx"
The direct assignment of an RxPath to an adapter/element is equivalent to calling FindSingle("myRxPath", Adapter.DefaultSearchTimeout). I don't see why that should make a difference in your Regex.Match calls. Once you make those calls, the element should already be found.
Could you please clarify what you mean by "match always fails"? Please, check whether the element t is found and what its TextValue is!
Regards,
Alex
Ranorex Support Team
Could you please clarify what you mean by "match always fails"? Please, check whether the element t is found and what its TextValue is!
Regards,
Alex
Ranorex Support Team
Re: Ranorex.Form="xxxxxxxx"
Thanks, I think i found the root cause.
On 'DirectX Diagnostic Tool', on Display/Sound/Input they all use Control, which has controlID=5008 to show 'No Error Found.'.
My actions is as below:
1. Click display
Ranorex.text t="/form[@title='DirectX Diagnostic Tool']/container/text[@controlid='5008']"
string s=t.textvalue
2. click sound
' note, here i didn't use t="/form[@title='DirectX Diagnostic Tool']/container/text[@controlid='5008']"
'again
s=t.textvalue
3. click input
s=t.textvalue
If i use t="xxxx" at step2 and 3 ,it's OK
So ,it 's the reason that result in
On 'DirectX Diagnostic Tool', on Display/Sound/Input they all use Control, which has controlID=5008 to show 'No Error Found.'.
My actions is as below:
1. Click display
Ranorex.text t="/form[@title='DirectX Diagnostic Tool']/container/text[@controlid='5008']"
string s=t.textvalue
2. click sound
' note, here i didn't use t="/form[@title='DirectX Diagnostic Tool']/container/text[@controlid='5008']"
'again
s=t.textvalue
3. click input
s=t.textvalue
If i use t="xxxx" at step2 and 3 ,it's OK
So ,it 's the reason that result in