[Solved] c# selenium if else check [closed]
[ad_1] This is what you are asking for if (rows == null) { continue; } else { rows.ElementAt(0).Click(); break; } However it’d be better code practice and more efficient to use a while loop implementation instead; IReadOnlyCollection<IWebElement> rows = null; bool rowsFound = false; while (!rowsFound) { rows = driveri.FindElements(By.XPath(“//*[@id=\”app\”]/div/span[3]/div/div/div/div/div/div/div[2]/div”)); if(rows!=null) { rowsFound = true; … Read more