cancel
Showing results for 
Search instead for 
Did you mean: 

Check if the element exists process. is using wait the correct approach?

KT
Level 4

Hi,

I am working to automate a web application that had pop up windows on it. The pop up window have a status bar below that shows if a record exists or not. I manage to spy and create an element for the status bar with the word record not found. My process is to check if this element exists or not to determine the search status. If a record exists, the pop up will disappear. I used the wait action to determine if the element exists or not. If not it should do another process. This is my design below. Is this a good practice that an action is connected to the timeout? Or another approach should be done?

15190.png



------------------------------
Kris Toledo
------------------------------
1 BEST ANSWER

Best Answers

Hi Kris Toledo,

It works as in the screenshot.

But I usually add additional condition  some thing like if pop up not exist and then go the next steps, but the approach I follow will never end up the time out Its just matter of preference I would say.

Adding the next steps at time out  in general not a bad idea in my opinion.

Thanks,

Harish



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

View answer in original post

3 REPLIES 3

harish.m
MVP

Hi Kris  Toledo,

I would do some thing like this based on the description you have provided

1)1st wait stage record found or not

a) if record found then go to the next step

b) if record not found go to step(2)

2) 2nd Wait wait stage has one  conditions

a) Pop up  check exist

If pop up exist  - I will try to close the popup and  navigate the screens if required to process the next item

If pop up not exist - either time out  and throw exception else handle to process the next step.



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

Thanks Harish!

For this one: If pop up not exist - either time out  and throw exception else handle to process the next step.

How is this gonna look on actions. Would it be the same as my picture? a process connected to the timeout if i needed to handle a process if the pop up not exists?



------------------------------
Kris Toledo
------------------------------

Hi Kris Toledo,

It works as in the screenshot.

But I usually add additional condition  some thing like if pop up not exist and then go the next steps, but the approach I follow will never end up the time out Its just matter of preference I would say.

Adding the next steps at time out  in general not a bad idea in my opinion.

Thanks,

Harish



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]