Skip to main content
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

I am sure even if the id of the hidden element is same of that of visible element; there will be an attribute which would be different. You would need to carefully investigate the attributes/locator. As @quinny1187@quinny1187 suggests XPath or css would be ideal way to do it!

ExecuteJavascript with unique attribute would prove useful in such cases. That always helps me in these situation where i would not be able to click on the element which is hidden.

For instance; driver.executeJavaScript("document.getElementBy"attribute"('attribute/locator').click();");instance:

driver.executeJavaScript("document.getElementBy"attribute"
('attribute/locator').click();");

I am sure even if the id of the hidden element is same of that of visible element; there will be an attribute which would be different. You would need to carefully investigate the attributes/locator. As @quinny1187 suggests XPath or css would be ideal way to do it!

ExecuteJavascript with unique attribute would prove useful in such cases. That always helps me in these situation where i would not be able to click on the element which is hidden.

For instance; driver.executeJavaScript("document.getElementBy"attribute"('attribute/locator').click();");

I am sure even if the id of the hidden element is same of that of visible element; there will be an attribute which would be different. You would need to carefully investigate the attributes/locator. As @quinny1187 suggests XPath or css would be ideal way to do it!

ExecuteJavascript with unique attribute would prove useful in such cases. That always helps me in these situation where i would not be able to click on the element which is hidden.

For instance:

driver.executeJavaScript("document.getElementBy"attribute"
('attribute/locator').click();");
Source Link

I am sure even if the id of the hidden element is same of that of visible element; there will be an attribute which would be different. You would need to carefully investigate the attributes/locator. As @quinny1187 suggests XPath or css would be ideal way to do it!

ExecuteJavascript with unique attribute would prove useful in such cases. That always helps me in these situation where i would not be able to click on the element which is hidden.

For instance; driver.executeJavaScript("document.getElementBy"attribute"('attribute/locator').click();");