Method click fails after successful execution

4 posts, 0 answers
  1. Oleg
    Oleg avatar
    2 posts
    Member since:
    Oct 2018

    Posted 16 Oct 2018 Link to this post

    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\
    ------------------------------------------------------------
     

  2. Nikolai
    Admin
    Nikolai avatar
    110 posts

    Posted 16 Oct 2018 Link to this post

    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!
  3. Oleg
    Oleg avatar
    2 posts
    Member since:
    Oct 2018

    Posted 17 Oct 2018 in reply to Nikolai Link to this post

    Hi, thanks for your prompt reply, i will try and come back with results
  4. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    995 posts

    Posted 19 Oct 2018 Link to this post

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