In
Create Network Container
-
It works by cutting and pasting your posted example. Your original source probably has tabs or other whitespace characters that don't match. Here are some alternatives:
1) Normalize spaces
//td[normalize-space(text()) = 'Create Network Container']
2) Compare using string value of td
(this will also match Create <b>Network</b> Container
)
//td[normalize-space(.) = 'Create Network Container']
3) Check for each word separately (ignores word order)
//td[contains(text(), 'Create') and contains(text(), 'Network') and contains(text(), 'Container')]
4) Strip whitespace, tabs, newlines, line-feeds, carriage returns and compare result:
//td[translate(text(), " 	
", "") = 'CreateNetworkContainer']
讨论(0)
-
Try this:
//td[matches(text(), '\s*Create\s+Network\s+Container\s*')]
To be honest this works for me in several evaluators I checked it in:
//td[text() = 'Create Network Container']
Previous try was to match all potential space-like characters that might be there (perhaps it's not just a single whitespace there and that's why this simpliest solution doesn't give you proper results.
讨论(0)
- 热议问题