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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

python - How to remove the Xframe Options header in django? -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -