Unable to click on close button using selenium

38 views
Skip to first unread message

Ramesh Sankar

unread,
Oct 19, 2017, 12:18:11 PM10/19/17
to webdriver
Hi Friends,

Unable to click on close button using selenium.Please find html code below,

<span class="icosolo icon_close close-console" id="console_close" ng-click="console('close')"></span>
    : :before == $ 0
</span>

I was used locating strategy as id & xpath but didn't work and even used java script for below that is also not woking

WebElement closeBut =  driver.findElement(By.xpath(".//*[@id='console_close']"));Thread.sleep(4000);
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", closeBut);

Any help would appreciated.

Regards,
Ramesh S

darrell grainger

unread,
Oct 20, 2017, 3:22:09 PM10/20/17
to webdriver
This is a web page using Angular. I'd have to see the entire DOM to be able to figure out how to do this. Clicking the span won't work, as you found out. You need to figure out what you click to trigger the appropriate Angular event.

Darrell

Jiithin S

unread,
Oct 26, 2017, 10:30:32 AM10/26/17
to webd...@googlegroups.com
Hi , could you post the console log here . Like what is the error you getting . 

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages