Selenium C# WebDriver: Wait until element is present

I want to make sure that an element is present before the webdriver starts doing stuff. I’m trying to get something like this to work: WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, 5)); wait.Until(By.Id(“login”)); I’m mainly struggling how to setup up the anonymous function… 27 Answers 27

Message “Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout”

I’m using Puppeteer and Jest to run some front end tests. My tests look as follows: describe(“Profile Tab Exists and Clickable: /settings/user”, () => { test(`Assert that you can click the profile tab`, async () => { await page.waitForSelector(PROFILE.TAB); await page.click(PROFILE.TAB); }, 30000); }); Sometimes, when I run the tests, everything works as expectedly. Other … Read more

Debugging “Element is not clickable at point” error

I see this only in Chrome. The full error message reads: “org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: …” The element that ‘would receive the click’ is to the side of the element in question, not on top of it and not overlapping it, not moving around … Read more

Get HTML source of WebElement in Selenium WebDriver using Python

I’m using the Python bindings to run Selenium WebDriver: from selenium import webdriver wd = webdriver.Firefox() I know I can grab a webelement like so: elem = wd.find_element_by_css_selector(‘#my-id’) And I know I can get the full page source with… wd.page_source But is there a way to get the “element source”? elem.source # <– returns the … Read more