Webdriver implicit and explicit wait for element locator.

Today most of web application using Ajax, When page is load some element load in a different time of interval or some time request send without page loading if the element not present then it through element not found exception or not visible element etc.. To handle this Webdriver provides two type of wait “implicit” and “explicit” wait

Implicit Wait: implicit wait provide to load DOM object for a particular of time before trying to locate element on page. Default implicit wait is 0. We need to set implicit wait once and it apply for whole life of Webdriver object. Add below line of code in test for implicit wait. However implicit wait slow down execution of your test scripts if your application responding normally.

driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

Calabash android predefined steps.

Calabash android has some predefined steps, you don’t need to define these steps in your steps definition ruby file. Just call these functions in your  feature file by passing valid argument.

Assertion steps:
Following are the some steps definition for the assertion

Then /^I see the text "([^\"]*)"$/  

Then /^I see "([^\"]*)"$/

Then /^I should see "([^\"]*)"$/ do

Then /^I should see text containing "([^\"]*)"$/ do

Then /^I should not see "([^\"]*)"$/ do

Then /^I don't see the text "([^\"]*)"$/ do

Then /^the view with id "([^\"]*)" should have property "([^\"]*)" = "([^\"]*)"$/ do

Then /^the "([^\"]*)" activity should be open$/ do