Chrome content verification

4 posts, 0 answers
  1. Erwin
    Erwin avatar
    3 posts
    Member since:
    Jun 2011

    Posted 30 Jun 2011 Link to this post

    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?
  2. Erwin
    Erwin avatar
    3 posts
    Member since:
    Jun 2011

    Posted 01 Jul 2011 Link to this post

    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?
  3. Erwin
    Erwin avatar
    3 posts
    Member since:
    Jun 2011

    Posted 01 Jul 2011 Link to this post

    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?
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 05 Jul 2011 Link to this post

    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?
Back to Top