Home >> Tags >> Waits

How to check if an element is present with protractor?

Before performing an action with an element, we just need to make sure of the presence of the element on the web page. When we try to interact with an element, if it is not present, it will throw an error/exception, so it is always important checking for the presence of the element.

Example : - When we click a Submit button, we know that we have to wait a second or two for something to happen. Here before trying to test the response, we can always check for element/s that are expected.

Synchronization in Selenium Webdriver

It is a mechanism which involves more than one components to work parallel with Each other.

Generally in Test Automation, we have two components
1. Application Under Test
2. Test Automation Tool.

Both these components will have their own speed. We should write our scripts in such a way that both the components should move with same and desired speed, so that we will not encounter "Element Not Found" errors which will consume time again in debugging.

Synchronization can be classified into two categories: