Scenario: On clicking reset button value should disappear and the field that holds the value should reset to blank.
Approach: My approach is to get text or innerHtml from id =mapPropertyHighlighted and make sure it is empty.
Challenge: How do I make sure text from id should be blank? How to add assertion because get text() is returning blank if an element has no value and not sure how to add assertion for blank value?
Is there any other way to verify value/text returned should be none/blank?
3
6
I think in Python you can check for None
or ""
on Empty string
Some options:
self.assertEqual(element.text, None)
self.assertEqual(element.text, "")
self.assertEqual(len(element.text), 0)
Also check this question for other options: https://stackoverflow.com/questions/9573244/how-to-check-if-the-string-is-empty
-
1
0
You can do assertation of null value for reset field.
public void testApp()
{
//true, check null
assertThat(null, is(nullValue()));
//or
//true, check null
assertThat(null, is(IsNull.nullValue()));
}
-
-
1