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

HTML Page parsing fails with certain Tag

1 Answer 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 20 Oct 2011, 11:30 AM
Hi

I just found an odd example where a Page cannot be parsed correctly and therefore, the Find.ByXXX fails with an exception!

Here's a very simple html of a page which fails:
<html>
    <head><title>Test</title></head>
    <body>
        Hello<b. xmlns="http://www.w3.org/1999/xhtml">World</b.>
    </body>
</html>

I know that this is an invalid Tag but shouldn't it be ignored instead of leading to exceptions when using the browser object?

Here's the C# code which leads to the exception:
Manager myManager = new Manager(false);
myManager.Start();
myManager.LaunchNewBrowser(BrowserType.InternetExplorer);
Browser browser = myManager.ActiveBrowser;
browser.NavigateTo("test.html");
Find finder = browser.Find;
string findPath = @"//li[@id='tab_CarsAndBikesTechnicalDetails1']/a";
Element foundElement = finder.ByName(findPath) ?? finder.ById(findPath);

And here's the exception I get:
Find Details:
- FindParam used: [Find logic: Use 'AttributesOnly' where (name=//li[@id='tab_CarsAndBikesTechnicalDetails1']/a) ]
- Start Element: [Element: '#text#:-1']
and the Inner exception is:
Start reference has to be a valid element and not an EndTag
Parameter name: Reference

Is there any possibility that such an invalid tag is ignored instead of leading to such exceptions?

Thanks for Help
Roman

1 Answer, 1 is accepted

Sort by
0
Accepted
Stoich
Telerik team
answered on 25 Oct 2011, 10:54 AM
Hi Roman,
      thank you for your feedback on this. I've managed to reproduce this and I've logged it as a bug:
http://www.telerik.com/support/pits.aspx#/public/test-studio/8293
500 Telerik points added to your account.

Kind regards,
Stoich
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Roman
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or