Regex Broken with Forward Slashes

Ask general questions here.
Chris3y
Posts: 4
Joined: Wed Aug 24, 2016 1:54 pm

Regex Broken with Forward Slashes

Post by Chris3y » Thu Sep 01, 2016 2:09 pm

I'm trying to map a page to the repo using regex but this seems to break if the domain contains slashes.

So.. dom/[@domain~'bbc.co.uk/news'] doesn't work unless you remove '/news' from the end of it.

My SUT absolutely requires we can match domains on strings that include slashes. Anyone found a work around? Putting a backslash before it doesn't work. :|

Chris3y
Posts: 4
Joined: Wed Aug 24, 2016 1:54 pm

Re: Regex Broken with Forward Slashes

Post by Chris3y » Thu Sep 01, 2016 2:12 pm

Ah never mind. I just realised you can use @pageurl instead. I guess domain specifically only checks the domains (and doesn't include subdomains or controllers)

Fair enough :mrgreen:

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Regex Broken with Forward Slashes

Post by krstcs » Thu Sep 01, 2016 2:23 pm

Yeah, the @Domain attribute only looks at the domain itself, which, technically, is the server name and top-level domain name of the site, without the page or query strings. If you need the rest, you can use the @Path (most likely what you want), @PageUrl (contains the whole thing), or @Page (just has the current page) attributes.
Shortcuts usually aren't...