I have a form which opens as a popup or iframe (I am not sure), and it has a cross icon which can close the popup.
Code of cross icon:
<a onclick="hideLayer('layer_1')" href="javascript:void(0)" class="cls11"></a>
I'd like to know how to simulate this in python-selenium. I used find_element_by_xpath
and click()
, but it gave SyntaxError
.
Selenium-code:
a = self.driver.find_element_by_xpath("//*[@id="xyz"]/a")
a.click()
It gives an error window - "invalid syntax in your program".