I only require one variable in the string at this point.
I have created a repository variable called varVariableName.
I have then modified my RxPath for the item to option[@innertext='DOW - '+$varVariableName+' {IN}'].
The test now finds the value correctly. One thing though. Is it possible to make it case insensitive?
Add Regular Expression when using a Variable
-
- Posts: 78
- Joined: Tue Dec 04, 2012 2:30 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Add Regular Expression when using a Variable
Hi,
I am glad it works now.
In the UserGuide section about the RxPath is a example about how to make it case insensitive, I copied it for you:
listitem[@text~'(?i:MyTeXt)']
matches the regular expression case-insensitive, e.g. 'mytext', 'MYTEXT','mYTeXT', ...
Regards,
Markus
I am glad it works now.
In the UserGuide section about the RxPath is a example about how to make it case insensitive, I copied it for you:
listitem[@text~'(?i:MyTeXt)']
matches the regular expression case-insensitive, e.g. 'mytext', 'MYTEXT','mYTeXT', ...
Regards,
Markus
-
- Posts: 78
- Joined: Tue Dec 04, 2012 2:30 pm
Re: Add Regular Expression when using a Variable
Great thanks!
Re: Add Regular Expression when using a Variable
Guys, thought I'd revive this thread as it's almost exactly what I'm after...and I seen a screenshot that was EXACTLY what I was after...but then nothing came of it.
I've got my head around repository variables for the most part (I think) but there's a scenario whereby the variable is in the domain.
If I then pass this into the code using something like:
it loads the page fine. However, waiting for the page to load fails.
This is causes the output for the domain to be:
I don't understand why it's loading the page fine, yet failing the WaitForPageLoad, when the XPath is:
Any & all assistance would be greatly appreciated.
Cheers
*EDIT* Nevermind, realised what was happening. Forgot a couple of apostrophes (^_^)
I've got my head around repository variables for the most part (I think) but there's a scenario whereby the variable is in the domain.
If I then pass this into the code using something like:
Code: Select all
repo.r_repoVariable = "www.test.com"
Code: Select all
WebDocument webDoc = "/dom[@domain="+repo.r_serverName+"]";
webDoc.WaitForDocumentLoaded();
Code: Select all
/dom[@[email protected]]
Code: Select all
/dom[@domain=$r_servername]
Any & all assistance would be greatly appreciated.
Cheers
*EDIT* Nevermind, realised what was happening. Forgot a couple of apostrophes (^_^)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Add Regular Expression when using a Variable
Hello,
It seems that you have missed the single quotes before/after the domain value.
Could you please try to use the following code snippet instead:
Regards,
Markus (T)
It seems that you have missed the single quotes before/after the domain value.
Could you please try to use the following code snippet instead:
WebDocument webDoc = "/dom[@domain='"+repo.r_serverName+"']"; webDoc.WaitForDocumentLoaded();Could you please try to set a higher timeout for WaitForPageLoaded (e.g. 5000)?
Regards,
Markus (T)
Re: Add Regular Expression when using a Variable
Thanks Markus,
I had actually edited the post prior to your response stating what you said, haha. You were spot on
Funny you should actually say set a longer timeout, possibly around 5000...as due to the fact I couldn't get this working initially, I set a delay with duration 5000 to replace it.
Great mind think alike?
Cheers again.
I had actually edited the post prior to your response stating what you said, haha. You were spot on

Funny you should actually say set a longer timeout, possibly around 5000...as due to the fact I couldn't get this working initially, I set a delay with duration 5000 to replace it.
Great mind think alike?
Cheers again.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Add Regular Expression when using a Variable
Hello,
That sounds great.
You are welcome
Regards,
Markus (T)
That sounds great.
You are welcome

Regards,
Markus (T)