Write a Java Program to open all links of gmail.com.
Answers
Create a new session object by calling getDefaultInstance()
method and passing properties as argument to get all of the important properties like hostname of the SMTP server etc.
method and passing properties as argument to get all of the important properties like hostname of the SMTP server etc.Create a MimeMessage object by passing the session object created in previous step.
method and passing properties as argument to get all of the important properties like hostname of the SMTP server etc.Create a MimeMessage object by passing the session object created in previous step.The final step is to send email using the javax.mail.Transport
★彡 Here is Your Answer 彡★
It is a typical example of advanced for loop which we have seen in our previous programs.
Once you have opened a website such as Gmail using get() or navigate().to(), you can use a tagName locator to find the tag name of a website which will return all the tags.
We have advanced for loop where we have created a new WebElement link2 for a link(which already has located
all the tags), then we have got all the links through getAttribute(“href”) and got all the texts through getText().
Ehsass 彡