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

Method click fails after successful execution

1 Answer 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Oleg
Top achievements
Rank 1
Oleg asked on 16 Oct 2018, 12:56 PM

Hi,

Got an element to click on, element located inside iframe , click confirm action and close iframe

Recorded action:

 

Click performed successful , iframe closed but click step fails with error:

System.TimeoutException: Wait for condition has timed out

 

Coded step :

Browser myFrame = ActiveBrowser.Frames["sb-player"]

Element xpath = myFrame.Find.ByXPath("//input[@id='submitRFPProcurementButton']");

 myFrame.Actions.Click(xpath);

Same behavior, log output :

'10/16/2018 8:50:20 PM' - 'Fail' : 44. Click 'MapProperty'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
Exception thrown executing coded step: 'Click 'MapProperty''.
InnerException:
System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Core.Browser.WaitUntilReady()
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Actions.Click(Element targetElement)
   at teststudio.RFP_Creation.RFP_Creation_CodedStep1() in c:\Users\Oleg\Documents\C360-Main-WebApp\e2e_tests_ts\tests\Global Regression Suite\
------------------------------------------------------------
 

1 Answer, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 16 Oct 2018, 03:40 PM
Hello Oleg,

Since the "Click" closes the iFrame which is represented as "Browser" instance, the validation "WaitUntilReady" fails because there is no Browser instance to handle the command. Thus, after a while there is a timeout error.

The above said, can you please try if the issue will be resolved after changing your code as follows:

Browser myFrame = ActiveBrowser.Frames["sb-player"];
Element xpath = myFrame.Find.ByXPath("//input[@id='submitRFPProcurementButton']");           
HtmlControl myElementAsControl = xpath.As<HtmlControl>();
//Click but don't trigger WaitUntilReady
myElementAsControl.Click(true);

This overload of the "Click" method is part of HtmlControl and its inheritors and will not trigger "WaitUntilReady" verification.

I hope this helps.

Regards,
Nikolai
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Oleg
Top achievements
Rank 1
commented on 17 Oct 2018, 09:04 AM

Hi, thanks for your prompt reply, i will try and come back with results
Elena
Telerik team
commented on 19 Oct 2018, 03:08 PM

Hi Oleg,

Thank you for your cooperation. Please do not hesitate to get back, in case you need further assistance. 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Oleg
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Share this question
or