If you just started to use selenium, is a legit question. I always suggest to have a look to the official doc.
An implicit wait is to tell WebDriver to poll the DOM for a certain
amount of time when trying to find an element or elements if they are
not immediately available. The default setting is 0. Once set, the
implicit wait is set for the life of the WebDriver object instance.
Example:
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = driver.findElement(By.id("myDynamicElement"));
In this case, if the web element with id myDynamicElement is not present in the DOM when you try to locate it, you are saying to re-try until 10 seconds. The polling time depends on the webdriver that you are using. The thing that you have to know is that it will try to find the element for 10 seconds. Of course, if the element is located before the end of this time, the code will go on. Otherwise, an exception is thrown.
An explicit wait is code you define to wait for a certain condition to
occur before proceeding further in the code. The worst case of this is
Thread.sleep(), which sets the condition to an exact time period to
wait. There are some convenience methods provided that help you write
code that will wait only as long as required. WebDriverWait in
combination with ExpectedCondition is one way this can be
accomplished.
Example:
WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")));
This waits up to 10 seconds before throwing a TimeoutException or if
it finds the element will return it in 0 - 10 seconds. WebDriverWait
by default calls the ExpectedCondition every 500 milliseconds until it
returns successfully. A successful return value for the
ExpectedCondition function type is a Boolean value of true, or a
non-null object.
And, at the end, there is written: This example is also functionally equivalent to the first Implicit Waits example.
So, if you use presenceOfElementLocated as expected condition (for each elements that you try to locate), is exactly the same to use an implicit wait. But there isn't only this as condition. As you can see from ExpectedConditions you can specify other conditions (example: elementToBeClickable, stalenessOf and so on).
So, returning to your question:
With
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
you are saying to wait, whenever you try lo locate an element, the presence (remember, it's like presenceOfElementLocated) until 30 seconds.
With
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
you are setting to 30 seconds the time that a webpage needs to be loaded.
With:
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(id)));
boolean status = element.isDisplayed();
You are saying that you want to wait the visibilityOfElementLocated, of the web element with id:"id", until 30 seconds.
Finally:
Why is it necessary to assign a WebElement to the following wait ,
what does WebElement element receive? Is this the right
implementation?
What does the WebElement element receive? what else if not the webelement with id:"id"? Of course, if it's visible. Otherwise, an exception will be thrown.