Keep on clicking button 1 until button 2 appears in selenium using java -
i testing native ios mobile app using selenium , appium java code. part of teardown, have keep on clicking "back" button until "setting" button appears can logout of application.
i tried few things using while not working. can please ?
try code may you
try { boolean flag = true; while(flag) { webelement backbtn = driver.findelementbyname("back"); backbtn.click(); thread.sleep(1000); boolean isfindsettingbtn = driver.findelementsbyname("setting").size() !=0; if(isfindsettingbtn) { break; } } }catch(exception e) { e.printstacktrace(); }
Comments
Post a Comment