Unable to click on icon

91 views
Skip to first unread message

Farheen Siddiqui

unread,
Nov 27, 2017, 11:41:59 AM11/27/17
to webdriver
Hi All,

I want to click on an icon which opens a form . I have used following code in my selenium script but it failed to locate the icon

driver.findElement(By.xpath(".//*[@id='createprojectform']")).click();

Below is the code of my page:

<span class="createprojects">
                                                <a id="createprojectform" class="ui-button ui-corner-all ui-widget" role="button">
                                                    
                                                    
                                                    <span class="icon-New_Project" style="right: 35px; top: -54px; position: absolute; font-size: 40px; color: #1E407C;" title="Create new projects"></span>
                                                </a>
                                            </span>

I am very new to selenium. Kindly  help m eout in resolving this issue

Thanks & Regards,
Farheen

Shobhit

unread,
Feb 21, 2018, 7:38:58 AM2/21/18
to webdriver

Hi, 

driver.findElement(By.id("createprojectform")).click();
also check whether button is enabled or not using isEnabled() method
Reply all
Reply to author
Forward
0 new messages