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:
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:
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
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