Tip for finding CSS & XPath locators using Chrome with an example:

Isn’t better to use more relative path? For xpath in example, for mentioned button:

.//*[@value=“Google Search”]

.//*[@name=“btnK”]

.//*[@jsaction=“sf.chk”]

.//*[@class=“jsb”]/center/input[1]

.//*[@style=“padding-top:18px”]/center/input[1]

.//*[@class=“tsf-p”]/div[3]/center/input[1]

.//*[@class=“tsf”]/div[2]/div[3]/center/input[1]

which can be easily obtained with this https://chrome.google.com/webstore/detail/xpal-xpath-generator-test/lpfjogcaifigkimnlkepjlkfhpdhebap add on?