Fixed screenshots not taken for elements with xpath selector