If you are wondering how you can trim the spaces in your xpath, this is how: The normalize-space function strips leading and trailing white-space from a string, replaces sequences of white-space characters by a single space, and returns the resulting string. Example : Which one is better? //td[starts-with(normalize-space(),'Text to Trim')] //td[starts-with(normalize-space(text()),' Text to Trim ')] The second option is better as it targets at the specific nodes More string functions in XPATH: Functions Description starts-with( string1 , string2 ) Returns true if the first string starts with the second string. contains( string1 , string2 ) Returns true if the first string contains the second string. substring( string offset length ) Returns a section of the string. The section starts at offset (which is a number), and is as long as the value provided at length. substring-before( string1 , string2 ) Returns the part of string1 up unti
I really appreciate sharing this great post. Keep up your work.Thanks for sharing this great article.
ReplyDeleteOnline Robot Framework Training
I’m really amazed with your posting skills as well as with the layout on your blog site.Very informative and well written post! Quite interesting and nice topic chosen for the post Nice Post keep it up.
ReplyDeleteOnline Robot Framework Training
ReplyDeleteIt seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training