Dialog popup at login

7 posts, 0 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    Sep 2011

    Posted 30 Sep 2011 Link to this post

    Hi
    In the application i have to test has a dialog popup right after login if the user already as a session open. before the dialog is not expected every time, the step will fail if the element is not found,
    is there a way ignore the step? I already have it set to continue on fail, but the report will report the failure,
    I have tried to verify the element to control an IF else steps, but that fails if the popup does not "pop"

    Please point me in the right direction

    Thank You
    Chris


    ArtOfTest.Common.Design.Exceptions.ElementFindException: Unable to locate element. Details: Attempting to find [Html] element using
    Find logic
     (Html): [tagname 'Exact' h3] AND [TextContent 'Exact' Login Conflict]

    Unable to locate element. Search failed!

       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost host, AutomationDescriptor descriptor, Int32 timeout)
       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

  2. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 30 Sep 2011 Link to this post

    I think you are looking for Continue on Failure where if the step fails it just goes on its way. 

    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/modifying-tests/steps-pane-overview.aspx

    As for the Dialogs try this link:

    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/recording-tests/dialogs.aspx

    Select the Generic
    and Select the Handle Button, I think you said it was "OK".

    I hope this helps,
    John
  3. Chris
    Chris avatar
    3 posts
    Member since:
    Sep 2011

    Posted 30 Sep 2011 Link to this post

    Hi John,
    Thank you for the reply,
    I currently have it set to "Continue on Failure" which it will continue with the testing,the problem is the test is being set as fail or failed because of it.

    the section on Dialogs appear to be for "Windows" dialogs not HTML dialog windows.
    I can already "click" the ok button if the box pops up but the step will fail if the box is not popped.

    I hope that clears my issue up a little more
    Thank You again!
    Chris
  4. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 30 Sep 2011 Link to this post

    Can you upload the script so I can see it...  I think I'm missing something there... 

    thanks,
    John Nicoulakos
  5. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 30 Sep 2011 Link to this post

    Hello Chris,

    You are on the right track with the IF/ELSE logical statement; it just needs an adjustment.

    The issue is with the Find Logic for the element used in the Verification attached to the IF statement. Currently it is this:

    [tagname 'Exact' h3] AND [TextContent 'Exact' Login Conflict]

    If there is no login conflict, then the TextContent won't match and that element will not be found. So, I recommend editing that Find Logic so the element is found for either scenario. Let's say, for example, that the two potential messages are "Login Conflict" and "Login Successful". You can change the Find Logic to this:

    [tagname 'Exact' h3] AND [TextContent 'StartsWith' Login]

    Ideally Test Studio uses IDs or other unique attributes to identify elements if they are available. I suspect TextContent was used in this case because that element does not have an ID.

    Once the element can be reliably found, the Verification can successfully drive the IF/ELSE statement:

    1. IF ( Verification = [h3 element] TextContent 'Contains' Login Conflict )
         Handle dialog

    2. ELSE
         (can be empty)

    3. (continue with normal test steps)

    Kind regards,
    Anthony
    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
  6. Chris
    Chris avatar
    3 posts
    Member since:
    Sep 2011

    Posted 30 Sep 2011 Link to this post

    Hi Anthony,
    if the box is not popped, the LoginConflictH3Tag will not exist so will it still work as you are suggesting?
    some how i need to watch for the html windows (dialog) pop or not and go from there.
    I figured if the IF statedment did not fine the element it would take that as a false and move on, but its not acting that way
    Thank You
    Chris
  7. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 30 Sep 2011 Link to this post

    Hi Chris,

    No, it won't. My suggestions were based on the assumption that the LoginConflitH3Tag element exists in either scenario, and only its TextContent changes based on the login status.

    The Verification attached to the IF statement must be based on an element that can be found in both scenarios. Hopefully there is another element on the page that meets this criteria. 

    I put in a Feature Request recently for another customer who had the same concern as you regarding logical statements. Specifically, they requested the ELSE portion execute unconditionally if the IF's Verification is not performed (like when its element cannot be found). Unfortunately there has not been an update on it yet.

    Regards,
    Anthony
    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
Back to Top