css - Selenium - unable to locate element for static text -
i trying find test-335 modal html snippet under:
<p class="statictext" data-name="title" data-reactid=".7.0.0.1">test-335</p>
i using below code-snippet:
by.cssselector("div[id=" + name + "] input[data-name=title]");
but throws error below:
"org.openqa.selenium.nosuchelementexception: unable locate element: {"method":"css selector","selector":"div[id=instviewfileservermodal] input[data-name=title]"}"
-- suggestions
if requirement not confined css, can use xpath below fetch text directly:
by.xpath("//p[.='test-335']")
this fetch p
tag exact innerhtml or inner text test-335
.
Comments
Post a Comment