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

Chrome content verification

3 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 1
Erwin asked on 01 Jul 2011, 04:26 AM
Hi,

Currently I'm using:
 - Windows 7 x64
 - vs2010
 - Chrome 12.0.742.112
 - Firefox 5.0
 - IE 9.0.8112.16421
 - Telerik Test Studio 2011.1.624_Trial

I have an html containing:
<title>Hello World</title>

I've tried:
Element element = Manager.ActiveBrowser.Find.ByContent("Hello World", FindContentType.InnerText);
Element element = Find.ByCustom(e => e.TextContent.Contains("Hello World"));
Element element = Manager.ActiveBrowser.Find.ByContent("Hello World);

Using Assert.IsNotNull(element); confirms that all of methods above works in IE and FF, but not in Chrome.
Does Find.ByContent work in Chrome?

3 Answers, 1 is accepted

Sort by
0
Erwin
Top achievements
Rank 1
answered on 01 Jul 2011, 06:58 AM
So I tried using:
Log.WriteLine(Manager.ActiveBrowser.ViewSourceString);
note: my html file is located in c:\Users\(User name)\Documents\

- IE and Firefox successfully navigated to the page, but not Chrome, showing in the log:
<body> Preparing browser for automation...</body>

- So I added some context to the html file and uploaded it. Next, I use the http url for test studio, but
I notice the string returned by ViewSourceString using Chrome starts from:
<body id=...

While the string returned by FF and IE starts with:
<HTML xmlns="...

So using "View Page Source" in Chrome correctly returns the page source, which starts with:
<HTML xmlns="...

In other word, In Chrome, the tag before <body> (including <title>) is ignored , thus creating the problem I described.

Now I believe this is a bug, or is there any setting I might be messed up with?
0
Erwin
Top achievements
Rank 1
answered on 01 Jul 2011, 07:17 AM
Another problem I encountered:
- I have inside my html file the following:
<div class="content_gray2" style="padding: 10px;">Thank you for
submitting your deal.<br />
 You will receive an email notification shortly.</div>

- By using Log.WriteLine(Manager.ActiveBrowser.ViewSourceString), I had the following:
1.
In IE using ViewSourceString:
<DIV style="PADDING-BOTTOM: 10px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 10px" class=content_gray2>Thank you for submitting your deal.<BR>You will receive an email notification shortly.</DIV>

2. In FF:
<div style="padding: 10px;" class="content_gray2">Thank you forsubmitting your deal.<br /> You will receive an email notification shortly.</div>

3. In Chrome:
<div class="content_gray2" style="padding: 10px;">Thank you forsubmitting your deal.<br> You will receive an email notification shortly.</div>

Are these small inconsistencies affecting my coded steps?
0
Cody
Telerik team
answered on 05 Jul 2011, 10:13 PM
Hello Erwin,

I have confirmed we have a problem access the <head> section of an HTML document under both Chrome and Safari. I have filed a bug on this here. You're right you can't even access it using ActiveBrowser.ViewSourceString.

In your last post "Are these small inconsistencies affecting my coded steps?" That all depends on the coded steps. It is the browser that is causing these small inconsistencies in the HTML source. We try hard with all our non-coded steps (including verification's) to insulate our customers from these browser idiosyncrasies. If it is causing you a real problem please give us more detail how they are causing you a problem.

Best wishes,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
Tags
General Discussions
Asked by
Erwin
Top achievements
Rank 1
Answers by
Erwin
Top achievements
Rank 1
Cody
Telerik team
Share this question
or