Tuesday, 9 May 2017

Check if either of element is located

I wanted to check , if element1 or element2 is present then return true.I use following code to check if element 1 is present.Now I want to check if either element with class name element1 or element2 is present, it should return true and finish the wait condition and move on to next line

driver.wait(until.elementLocated(by.className('element1')), 10000);

Basically something like below ? :P

driver.wait(until.elementLocated(by.className('element1 || element2')), 10000);



via Vishnu

No comments:

Post a Comment