void Scroll(DinamicElement scrollEl, int x) { scrollEl.Interaction(el => { var scrolabelBlock = el.FindElement(By.TagName("ul")); IJavaScriptExecutor js = (IJavaScriptExecutor)Driver; js.ExecuteScript($"arguments[0].scrollBy(0, {x})", scrolabelBlock); }); }
public void Open() { var timer = 0; if (checkForOpen()) { return; } handler.Interaction((el) => { el.Click(); }); while (checkForOpen() == false) { Thread.Sleep(50); timer += 50; if (timer > 1000) { timer = 0; handler.Interaction((el) => { el.Click(); }); } } bool checkForOpen() { bool result = false; chosenContainer.Interaction((el) => { result = el.GetAttribute("class").Contains("chosen-with-drop"); }); return(result); } }