Waiting for Condition , even after clicking the element

2 posts, 0 answers
  1. Nithya
    Nithya avatar
    32 posts
    Member since:
    Aug 2016

    Posted 19 Jun Link to this post

    Hi,

    I have a piece of code which is functioning correctly as expected. But the step still waits for the element and fails always..

    Explanation about the step : There are two menu items, only one appears at a time based on some conditions..I want to click the menu items. I write a piece of code saying if (a="x") ,  then Click the menu item

    Else Click on menu item and click on button..

    I have 2 iterations in which the first iterations satisfies the Else condition and works perfect.. Second iteration satisfies If condition and Works perfect. But even after clicking the menu item, the step is not exiting , it still looks for element and fails as "Wait for condition timed out"

     

    Code Snippet :

     

    Public Sub Test()

               Dim Menu = Pages.xxx.ListItem6.Innertext
               Dim  a = Menu

         If (a=sample test") then
                  Pages.xxx.ListItem6.Focus
                  Pages.xxx.ListItem6.Select
                  Pages.xxx.ListItem6.MouseClick
                  
                 Else
                  Pages.xxx.ListItem6.Focus
                  Pages.xxx.ListItem6.Select
                  Pages.xxx.ListItem6.MouseClick
                  System.Threading.Thread.Sleep(2000)
                  ' Call the other sub procedure here
                 call Nithya_Test ----------------------- In this procedure , I click the button in the pop up
             End If   

    End Sub

    Could you please help me to fix this..

     

    Regards,

    Nithya A.

  2. Plamen Mitrev
    Admin
    Plamen Mitrev avatar
    88 posts

    Posted 20 Jun Link to this post

    Hello Nithya,

    I reviewed the shared details and I believe that the "Wait for condition timed out" is caused by the next step in your test. I am not sure how the code in the "if" can cause such misbehavior. As you mentioned, both iterations work as expected and perform the expected click actions.

    That said, I would like to investigate this issue further and to do that I will need you help. Please archive and attach the .tstest file along with the .tstest.vb, located in the project folder, file associated with this test. In addition to that I would like to review the step failure details, so please export them and send them over. This way I will be able to get a better understanding about the test and the encountered issue.

    I am looking forward to hearing from you.

    Regards,
    Plamen Mitrev
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top