Applying regex on file path from variable in RanoreXpath

Ask general questions here.
tejas.deshpande
Posts: 32
Joined: Fri May 20, 2016 9:43 am

Applying regex on file path from variable in RanoreXpath

Post by tejas.deshpande » Fri May 20, 2016 10:08 am

Hello,

In my application, on loading a file of path say "C:\Folder1\Folder2\Notepad.txt", a new tab opens with Title "Notepad.txt". This Title changes with every file that is loaded.
Tab.PNG
Tab.PNG (2.1 KiB) Viewed 545 times
I store the file's path in a variable say "FilePath" and link it to an excel source.

I need to...

Validate "Title' of the Tab using AttributeRegEx on variable FilePath to get only the file's name i.e. "Notepad.txt" or "XYZ.ext.1" to identify & validate the displayed Title of the Tab.
ValidationImage.PNG
ValidationImage.PNG (3.2 KiB) Viewed 545 times
I do not wish to use code mainly for simplicity.

How should I proceed?

Also, this is blocking my work. I would appreciate a suggestion ASAP!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Applying regex on file path from variable in RanoreXpath

Post by odklizec » Fri May 20, 2016 12:29 pm

Hi,

I'm afraid, it's currently not possible to combine regex and variable in AttributeRegEx command. You will have to use custom code to achieve what you want.
Please take a look at my post here:
http://www.ranorex.com/forum/attributer ... tml#p28948
Pavel Kudrys
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

tejas.deshpande
Posts: 32
Joined: Fri May 20, 2016 9:43 am

Re: Applying regex on file path from variable in RanoreXpath

Post by tejas.deshpande » Fri May 20, 2016 2:33 pm

Can I send a feature request for this functionality?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Applying regex on file path from variable in RanoreXpath

Post by odklizec » Fri May 20, 2016 2:45 pm

Sure, send it to [email protected], which is a proper channel for feature requests.
Pavel Kudrys
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

tejas.deshpande
Posts: 32
Joined: Fri May 20, 2016 9:43 am

Re: Applying regex on file path from variable in RanoreXpath

Post by tejas.deshpande » Wed May 25, 2016 7:19 am

Thanks Pavel, for the quick response!