Hi all.
As we have to support multi-browser automated tests, the tests must run in both IE and Firefox.
After installing the latest build of WebAii we finally can work fine with both of them.
Still I suspect a funny problem with these browsers because they render non-breakable space ( ) in different manner.
Just have a look at this piece of HTML code:
Looks usual.
But now, if I want to find this link by the text it contains, troubles appear.
You can switch the browser type right in the first line of the code.
The general trouble is that I cannot process this link in the same way in FF and IE.
The second problem is that the types of spaces in the text can change (so the appearance of the text would be the same, but spaces would be different).
So we need a way of finding elements on the page which will not depend on:
1) browser type
2) type of spaces used by developers.
It would be really good if there is such a way, because our tests use Find.ByContent very often.
Thanks,
Yaroslav
As we have to support multi-browser automated tests, the tests must run in both IE and Firefox.
After installing the latest build of WebAii we finally can work fine with both of them.
Still I suspect a funny problem with these browsers because they render non-breakable space ( ) in different manner.
Just have a look at this piece of HTML code:
<
a
href
=
"http://google.com"
>mega link</
a
>
Looks usual.
But now, if I want to find this link by the text it contains, troubles appear.
Settings settings =
new
Settings(BrowserType.InternetExplorer,
"d:\\log\\"
);
Manager manager =
new
Manager(settings);
manager.Start();
manager.LaunchNewBrowser();
manager.ActiveBrowser.NavigateTo(
"http://aspspider.ws/kovyar/find_bycontent_test.htm"
);
manager.ActiveBrowser.WaitUntilReady();
Element element = manager.ActiveBrowser.Find.ByContent(
"mega link"
);
//null in both browsers, the desired way to find the element
Element element1 = manager.ActiveBrowser.Find.ByContent(
"mega link"
.Replace(
' '
, (
char
)160));
//null in IE
Element element2 = manager.ActiveBrowser.Find.ByContent(
"mega link"
.Replace(
" "
,
" "
));
//null in FF
Assert.IsNotNull(element1);
//here fails IE
Assert.IsNotNull(element2);
//here fails FF
manager.Dispose();
You can switch the browser type right in the first line of the code.
The general trouble is that I cannot process this link in the same way in FF and IE.
The second problem is that the types of spaces in the text can change (so the appearance of the text would be the same, but spaces would be different).
So we need a way of finding elements on the page which will not depend on:
1) browser type
2) type of spaces used by developers.
It would be really good if there is such a way, because our tests use Find.ByContent very often.
Thanks,
Yaroslav