This works fine if I search for a single string:
var element = Driver.FindElement(By.XPath("//a[contains(text(), 'About us')]"));
But could I have an or statement like in the example below?
var element = Driver.FindElement(By.XPath("//a[contains(text(), 'About us' or 'about us')]"));
say or
between two calls of contains
function
//a[contains(text(), 'About us') or contains(text(), 'about us')]
or use translate
function to make xpath case insensitive
//a[contains(translate(text(), 'ABOUTS', 'abouts'), 'about us')]
Below satisfies your requirement:-
//a[contains(., 'About us') or contains(., 'about us')]
Refer:- https://sqa.stackexchange.com/questions/10342/how-to-find-element-using-contains-in-xpath for more details.