ajitjaiswal50 / selenium-vba

Automatically exported from code.google.com/p/selenium-vba
0 stars 0 forks source link

How to click button with no ID, Name or Value #138

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Operating system : Win 7
.Net Framework version :
Office Version : Excel 2010
SeleniumWrapper version :10.23.0

What is your issue ?

I'm trying to close the pop-up window after opening a website. The "close" 
button html code is like in the following:

<div class="ui-dialog-buttonset"><button aria-disabled="false" role="button" 
class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" 
type="button"><span class="ui-button-text">FEEDBACK</span></button><button 
aria-disabled="false" role="button" class="ui-button ui-widget ui-state-default 
ui-corner-all ui-button-text-only" type="button"><span 
class="ui-button-text">CLOSE</span></button></div>

The two buttons "feedback" and "close" have identical attributes too that 
confuse me very much.

I've tired code like 
selenium.findElementByXPath("//button[@role='button']/span[@class='ui-button-tex
t']").Click

It doesn't work. Could you help/support me with that?

Original issue reported on code.google.com by wangxinz...@gmail.com on 12 Feb 2015 at 11:33

GoogleCodeExporter commented 8 years ago
I used unique selector and problem solved. Thanks for attention.

Original comment by wangxinz...@gmail.com on 13 Feb 2015 at 6:44

GoogleCodeExporter commented 8 years ago

Original comment by florentbr on 18 Feb 2015 at 5:34