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

Login and iFrame Issue

4 Answers 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mariko
Top achievements
Rank 1
Mariko asked on 21 Oct 2011, 04:39 AM
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

4 Answers, 1 is accepted

Sort by
0
Mariko
Top achievements
Rank 1
answered on 23 Oct 2011, 01:44 PM
Hello,
 Any updates please?
0
Anthony
Telerik team
answered on 25 Oct 2011, 09:36 PM
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
0
Mariko
Top achievements
Rank 1
answered on 26 Oct 2011, 07:36 AM
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

0
Accepted
Anthony
Telerik team
answered on 26 Oct 2011, 05:06 PM
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
Tags
General Discussions
Asked by
Mariko
Top achievements
Rank 1
Answers by
Mariko
Top achievements
Rank 1
Anthony
Telerik team
Share this question
or