I have an variable called user and I want to use it with a regex character ?
Normaly this works for every element that includes the word John
.//ul[#'messaging_list']/?/div/div/?/h3[?'john']
I want to combine this with the variable $user and I dont know how will I do it, please help.
if I wrote sth like ?$user 't does not accept and returns to previous one/
How to use a regex character and a variable together ?
Re: How to use a regex character and a variable together ?
Hi,
It should be possible to use something like this (just an example)...
h3[@InnerText~'?'+$user]
But I'm not quite sure if the same could be done without the attribute name (as in your sample path)? Just try it
It should be possible to use something like this (just an example)...
h3[@InnerText~'?'+$user]
But I'm not quite sure if the same could be done without the attribute name (as in your sample path)? Just try it
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to use a regex character and a variable together ?
Hi odklizec thanks for the relpy I have one more question
Ranorex gives this regex example for repository and it works fine in repository
/form/button[@text>'sample']
How can I do the same thing in actions ?
for example
I have a Validation action and its Match Value should be start with the variable client
normaly $client works for full name, but I want it to be start client variable
^$client
does not work
Thanks
Ranorex gives this regex example for repository and it works fine in repository
/form/button[@text>'sample']
How can I do the same thing in actions ?
for example
I have a Validation action and its Match Value should be start with the variable client
normaly $client works for full name, but I want it to be start client variable
^$client
does not work
Thanks
Re: How to use a regex character and a variable together ?
You cannot directly combine the regex expression with the variable name, you have to do string concatenation.
[@text ~ '^' + $client]
So, if client = 'John Smith', the resulting value would be '^John Smith'.
You could also use the > (starts with) operator for text: [@text>$client].
See this page in the user guide for more information.
[@text ~ '^' + $client]
So, if client = 'John Smith', the resulting value would be '^John Smith'.
You could also use the > (starts with) operator for text: [@text>$client].
See this page in the user guide for more information.
Shortcuts usually aren't...
Re: How to use a regex character and a variable together ?
Hi krstcs
I am not asking for repository items as I mentioned in the mail
so there is not situation like this -> [@text ~ '^' + $client]
I know the page you wrote but it deals only with repository items in that page
I amsking for Match Value column in the Actions
please check the attachment
Thanks,
Rastek.
I am not asking for repository items as I mentioned in the mail
so there is not situation like this -> [@text ~ '^' + $client]
I know the page you wrote but it deals only with repository items in that page
I amsking for Match Value column in the Actions
please check the attachment
Thanks,
Rastek.
You do not have the required permissions to view the files attached to this post.
Re: How to use a regex character and a variable together ?
First, you didn't say any of that in either of your other posts, so I didn't know that was the case. When you post, please provide all pertinent information.
Second, you should use Validate.AttributeContains or Validate.AttributeRegex instead of Validate.AttributeEqual. Equal ALWAYS requires character for character match, no regex.
Second, you should use Validate.AttributeContains or Validate.AttributeRegex instead of Validate.AttributeEqual. Equal ALWAYS requires character for character match, no regex.
Shortcuts usually aren't...