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

Waiting for Condition , even after clicking the element

1 Answer 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nithya
Top achievements
Rank 1
Veteran
Nithya asked on 19 Jun 2019, 01:08 PM

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.

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 20 Jun 2019, 10:30 AM
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!
Tags
General Discussions
Asked by
Nithya
Top achievements
Rank 1
Veteran
Answers by
Plamen Mitrev
Telerik team
Share this question
or