user3713453
user3713453

Reputation: 97

Selenium webdriver Unable to locate element

I've been trying to get the element of this status message after adding an existing record. Still don't have luck on trying to make it work. Any ideas on getting this element? Any answers will be much appreciated thank you!

enter image description here

UPDATE::

I can get the element of [ 10:45:02 - HR206 ]Job Record Already Exists what i only need is the Job Record Already Exists w/o the time.

Upvotes: 0

Views: 81

Answers (1)

murali selenium
murali selenium

Reputation: 3927

Did you try with xpath = //ul[@id='currentMessage']/li

String message=driver.findElement(By.xpath("//ul[@id='currentMessage']/li")).getText();

Thank You

Upvotes: 1

Related Questions