This is a migrated thread and some comments may be shown as answers.

textcontent return text without newLine character

8 Answers 219 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 27 Sep 2012, 10:53 AM

try to take textcontent or innertext from multiline element.

<td>

123

<br>

321

</td>

textcontent return 123321 but selenium return 123\r\n321

8 Answers, 1 is accepted

Sort by
0
Anton
Top achievements
Rank 1
answered on 02 Oct 2012, 03:07 PM
oK, Thanks.
0
Byron
Telerik team
answered on 02 Oct 2012, 03:35 PM
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
0
Anton
Top achievements
Rank 1
answered on 02 Oct 2012, 03:42 PM
Assert.AreEqual("123\r\n321", Find.ById<HtmlTableCell>("showTableId_te_cell-8:2").TextContent);
0
Accepted
Byron
Telerik team
answered on 05 Oct 2012, 06:43 PM
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
0
Anton
Top achievements
Rank 1
answered on 08 Oct 2012, 10:56 AM

Ok, Thanks for answer.

But maybe it's good feature to implement?!

0
Byron
Telerik team
answered on 10 Oct 2012, 10:16 PM
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
0
Vinay
Top achievements
Rank 1
answered on 04 Mar 2015, 03:57 PM
Hi Telerik,

Please let me know that the above discussed feature has been added or not yet?
0
Ivaylo
Telerik team
answered on 09 Mar 2015, 11:21 AM
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
 
Tags
General Discussions
Asked by
Anton
Top achievements
Rank 1
Answers by
Anton
Top achievements
Rank 1
Byron
Telerik team
Vinay
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or