Let me tell you what exactly you will learn today and why I am covering this.
I had one scenario where some element was invisible and the requirement was I had to click on that elements. As we know Selenium does not that capability that it can change the visibility of Element.
- First, we will identify what exception is coming from the script.
If you are new in Java then check Java topics for Selenium which will help you to understand Selenium easily.
// First identify element
WebElement elem = driver.findElement(By.xpath(".//*[@id='__dialog1-footer']/button/div"));
// This will enable this element if element is invisible
String js = "arguments.style.height='auto'; arguments.style.visibility='visible';";
// Execute the Java Script for the element which we find out
// Click on element
This is one of the shortest posts but it is useful when you get stuck with some scenario. Let me know your thoughts on this in below comment section.
For More updates Learn Automation page
For any query join Selenium group- Selenium Group