extract domain

Ask general questions here.
mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

extract domain

Post by mander95 » Thu Dec 01, 2016 8:34 pm

This is the path for a repository item that I am currently using.

/dom[@caption~'^Education\ -\ View\ My\ Consu']//div[#'mCSB_1']/?/?/ul/?/?/a[@innertext='Breast Lift' and @href='https://stage-pp-web/patient/education.php?topic_id=3']

What is the most efficient way to extract the domain from this item?

For example:
reposItem.Element.GetAttributeValueText("caption").ToString();

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

Re: extract domain

Post by odklizec » Fri Dec 02, 2016 10:14 am

Hi,

This method should return Domain name from provided repo element:

Code: Select all

		public void GetDomainFromRepoElement(Adapter repoElement)
		{
			WebDocument elementParent = argument1.Element.TopLevelAncestor;
			string domainName = elementParent.Domain;
			Report.Info("domainName: ", domainName);
		}
Put this method to recording of your choice and set required repo element as a parameter. Hope this helps?
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

mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

Re: extract domain

Post by mander95 » Tue Dec 06, 2016 7:30 pm

It works, thank you :D :D :D :D :D :D

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

Re: extract domain

Post by odklizec » Wed Dec 07, 2016 8:04 am

You are welcome. Nice to hear it worked for you ;)
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