0

I wanted to ask if it is possible to extract a sting from the IWebElement definition. My goal is to avoid redundancy and remove the locators from the definition (in a large file, the locators' paths are less readable compared to the aligned paths for IWebElement objects.

Example: I want to extract the value of "html body" from the public IWebElement htmlBody.

Is anyone able to help me? enter image description here

enter image description here

enter code here
L_J
  • 2,351
  • 10
  • 23
  • 28

1 Answers1

0

If I understood your problem correctly, You want to get HTML body text. One way to get whole page source is :

var source = driver.PageSource;

Then you can easily extract body text contained between and tag.

Raj
  • 664
  • 7
  • 23