textcontent return text without newLine character

9 posts, 1 answers
  1. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 27 Sep 2012 Link to this post

    try to take textcontent or innertext from multiline element.

    <td>

    123

    <br>

    321

    </td>

    textcontent return 123321 but selenium return 123\r\n321

  2. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 02 Oct 2012 Link to this post

    oK, Thanks.
  3. Byron
    Admin
    Byron avatar
    184 posts

    Posted 02 Oct 2012 Link to this post

    Hello Anton,

    I apologize: the issue referred to in the previous response is specific to Test Studio Standalone. So that we can advise you on coding the verification correctly to include the escape characters, please let us know the code you are using currently.

    Greetings,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  4. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 02 Oct 2012 Link to this post

    Assert.AreEqual("123\r\n321", Find.ById<HtmlTableCell>("showTableId_te_cell-8:2").TextContent);
  5. Answer
    Byron
    Admin
    Byron avatar
    184 posts

    Posted 05 Oct 2012 Link to this post

    Hi Anton,

    It is expected behavior for the TextContent and InnerText to omit HTML. The InnerMarkup attribute will include HTML tags like <td> and <br>; however, it will not include ASCII special characters such as \r and \n. All the attributes exposed by the Framework are present in the DOM. Because the DOM does not contain carriage return or newline characters, Test Studio does not access these. Although similar information can be derived from the InnerMarkup attribute, there is no existing attribute in the Framework that will return values consistent with those in your data source.

    Regards,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 08 Oct 2012 Link to this post

    Ok, Thanks for answer.

    But maybe it's good feature to implement?!

  7. Byron
    Admin
    Byron avatar
    184 posts

    Posted 10 Oct 2012 Link to this post

    Hi Anton,

    I have submitted a feature request for this feature, which you can follow in our Public Issue Tracking System (PITS). As thanks for your feature request, I have transferred 500 Telerik Points to your Telerik.com account. Please let us know if we can assist you further.

    Regards,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  8. Vinay
    Vinay avatar
    16 posts
    Member since:
    Jan 2015

    Posted 04 Mar 2015 in reply to Byron Link to this post

    Hi Telerik,

    Please let me know that the above discussed feature has been added or not yet?
  9. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 09 Mar 2015 Link to this post

    Hello Vinay,

    Please note that you are updating way too old thread. Test Studio has changes a lot since 2012. Please submit a brand new ticket with your scenario and we will take a look at the specific problem you are experiencing.

    Thank you for your understanding.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top