C# Syntax
public class XPathDescription : HP.LFT.SDK.PropertiesDescription, HP.LFT.SDK.IDescription
[Test] public void verify_InnerText() { // Open the Chrome browser. var browser = BrowserFactory.Launch(BrowserType.Chrome); // Use Try/Catch to add a warning to the run report if the assert validation fails. try { // Navigate to the New Tours website. browser.Navigate("https://www.advantageonlineshopping.com/"); // Locate the link object using its XPath. var speakersCategoryLink = browser.Describe<ILink>(new XPathDescription("//DIV[@id=\"speakersImg\"]")); // Verify the innerText value. Assert.AreEqual("SPEAKERS Shop Now ", speakersCategoryLink.InnerText); } catch (Exception e) // Use a ReportEvent step to add details to the results report if there is an error in the test. { Reporter.ReportEvent("verify_innerTextIsPresented", "Failed during validation", Status.Failed, e); throw; } finally { browser.Close(); } }
System.Object
HP.LFT.SDK.PropertiesDescription
HP.LFT.SDK.Web.XPathDescription
Name | Description | |
---|---|---|
XPathDescription Constructor | Overloaded. Initializes a new instance of the XPathDescription class. |
Name | Description | |
---|---|---|
Clone | Creates an exact copy of the test object. (Inherited from HP.LFT.SDK.PropertiesDescription ) | |
ToString | ToString override. The string representation of this XPathDescription object. |
Implicit Type Conversion | Implicit cast of the specified string to an XPathDescription. |