I'm using web driver to automate a test case. I'm trying to verify the text present in the page or not. I'm doing the following, but I don't know how to verify the textPresent is what I'm actually looking for.
textPresent = driver.find_element_by_xpath ("//span/p") then when I did textPresent.text it's giving the text "An error occured processing Order" where I'm actually looking for "Successfuly added to processing" in the same xpath location. So in this situation, I want to fail the test case. How do i do that?
textattribute of the returned object and compare.//span/pis a too broad selector and does not guarantee that the returned element is the one you are looking for.assert(textPresent == 'Successfully added to processing')