Login and iFrame Issue

5 posts, 1 answers
  1. Mariko
    Mariko avatar
    39 posts
    Member since:
    Jun 2011

    Posted 20 Oct 2011 Link to this post

    Hi Telerik Team,

    1. I have two steps that handles the two dialog pop ups, the second step that handles the dialog pop up always fails. I've already included execution delay. Is that an issue? or is there a way that i can create a handler code that always run upon execution and will trigger when it detects a dialog pop-up? Like a application config.

    Here's the error:

    Timed out waiting '5000' msec. for any dialog to be handled '1'InnerException:System.TimeoutException: Timed out waiting '5000' msec. for any dialog to be handled '1' at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilAnyHandled(IEnumerable`1 dialogs, Int32 handleCount, Int64 timeoutMilliseconds, Boolean resetHandleCount) at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilHandled(Int32 handleCount, Int32 timeout, Boolean resetHandleCount) at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(Browser browser) at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(IAutomationHost browser) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)


    2. My recording doesn't recognize the object inside the iframe? I've already removed the BaseUrl of the IFrame and when I execute the test it fails. How can i remove the Frame Src?

    UPDATE: I've already set UseQuery Property to False and Query Property to blank of the Frame Element.

    Here is the error:

    Unable to locate element. Details: Attempting to find [Html] element using Find logic (Html): [id 'Exact' ctl00_m_g_32993630_d000_446f_aae0_0651008dc19b_ctl00_ctl02_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem] AND [tagname 'Exact' input]Inside Frame:[Frame:name=Frame_0,src=http://gtpdoc/sites/20114/MT1G!/1/MTG6,UseQuery:True]Unable to locate element. Search failed!


    Note: The Frame Scr is dynamic since it is based on a record id.

    Thanks
  2. Mariko
    Mariko avatar
    39 posts
    Member since:
    Jun 2011

    Posted 23 Oct 2011 Link to this post

    Hello,
     Any updates please?
  3. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 25 Oct 2011 Link to this post

    Hi Mariko,

    1. For dialog handling to function properly, you often must set the SimulateRealClick property to True for the 'Click' step that triggers the dialog. 

    Another option is to manually set the UnexpectedDialogAction behavior with code like this:

    Settings.Current.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;

    Just put this code in a Coded step and place it before the step where you expect the dialog to appear. 

    Now, you can change it again for the step where you want to handle the dialog by putting another Coded step with the following code:

    Settings.Current.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;

    Note that setting the UnxpectedDialogAction in this way will also work even if you run your test from Quick Execution.   


    2. If the actual Frame could not be found you would receive a different error. See here for more information.

    I believe the Find Logic on the element itself is too specific:

    • id 'Exact' ctl00_m_g_32993630_d000_446f_aae0_0651008dc19b_ctl00_ctl02_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem 

    I suspect that ID is dynamic. If so, change 'Exact' to 'Contains' and edit the ID so it only contains the static portion.

    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
  4. Mariko
    Mariko avatar
    39 posts
    Member since:
    Jun 2011

    Posted 26 Oct 2011 Link to this post

    Hi Anthony,

    1. Is there a way that i can modify the find logic during the execution of the script?

    2. I can't find the table element using hard code in the RadHtmlPlaceholder iframe. the table is inside the RadHtmlPlaceholder iframe.

    Here's the code:

    HtmlTable table = Find.ById<HtmlTable>("onetidDoclibViewTbl0");

    Assert.IsNotNull(table);

    Thanks

  5. Answer
    Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 26 Oct 2011 Link to this post

    Hi Mariko,

    1. You can  Data Drive Find Expressions through code.

    2. You must identify the frame first, then locate the element through the frame. See here for more information. Here's a basic example:

    ArtOfTest.WebAii.Core.Browser myFrame = ActiveBrowser.Frames["OneFrame"];
    myFrame.RefreshDomTree();
     
    Element e = myFrame.Find.ById("CFC");
    myFrame.Actions.Click(e);

    Best wishes,
    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