Page 1 of 1

extract domain

Posted: Thu Dec 01, 2016 8:34 pm
by mander95
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();

Re: extract domain

Posted: Fri Dec 02, 2016 10:14 am
by odklizec
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?

Re: extract domain

Posted: Tue Dec 06, 2016 7:30 pm
by mander95
It works, thank you :D :D :D :D :D :D

Re: extract domain

Posted: Wed Dec 07, 2016 8:04 am
by odklizec
You are welcome. Nice to hear it worked for you ;)