Regular expression

Ask general questions here.
Posts: 29
Joined: Wed Jan 15, 2014 3:32 pm

Regular expression

Post by NewLearner » Mon May 25, 2015 12:35 pm

//div[#'FI_Cv_Exploratory_Inbound_SP,none:Carrier IATA Code:nkGlobalMap_941751663_(All)']/?/?/a[@innertext='(All)']

i need to use regular expression for this 941751663 will keep changing.. how to use regular exp for about path


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

Re: Regular expression

Post by odklizec » Mon May 25, 2015 12:58 pm


I'm afraid, it's not possible to use regular expressions (or variables) within unique IDs (ID starting with # sign). To be able to use reg. expressions (and/or variables) in your path, you will have to use another attribute (e.g. ID). So the path should look like this (use whatever/better regex you want):

Code: Select all

//div[@id~'(FI_Cv_Exploratory_Inbound_SP,none:Carrier IATA Code:nkGlobalMap_)(\d*)(_\(All\))']/?/?/a[@innertext='(All)']
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