Selenium waitForElement

From the Selenium Documentation PDF : import contextlib import selenium.webdriver as webdriver import selenium.webdriver.support.ui as ui with contextlib.closing(webdriver.Firefox()) as driver: driver.get(‘http://www.google.com’) wait = ui.WebDriverWait(driver,10) # Do not call `implicitly_wait` if using `WebDriverWait`. # It magnifies the timeout. # driver.implicitly_wait(10) inputElement=driver.find_element_by_name(‘q’) inputElement.send_keys(‘Cheese!’) inputElement.submit() print(driver.title) wait.until(lambda driver: driver.title.lower().startswith(‘cheese!’)) print(driver.title) # This raises # selenium.common.exceptions.TimeoutException: Message: None # … Read more

Auto-generation of .NET unit tests [closed]

Take a look at Pex. Its a Microsoft Research project. From the website: Pex generates Unit Tests from hand-written Parameterized Unit Tests through Automated Exploratory Testing based on Dynamic Symbolic Execution. UPDATE for 2019: As mentioned in the comments, Pex is now called IntelliTest and is a feature of Visual Studio Enterprise Edition. It supports … Read more

How to use Selenium with Python?

You mean Selenium WebDriver? Huh…. Prerequisite: Install Python based on your OS Install with following command pip install -U selenium And use this module in your code from selenium import webdriver You can also use many of the following as required from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException Here is … Read more

Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer

try this out: sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections sudo apt-get -y install oracle-java7-installer running 3rd and 4th command on my debian 7.1 helps, so I think the same can help on ubuntu as well

How to Automatically Start a Download in PHP?

Send the following headers before outputting the file: header(“Content-Disposition: attachment; filename=\”” . basename($File) . “\””); header(“Content-Type: application/octet-stream”); header(“Content-Length: ” . filesize($File)); header(“Connection: close”); @grom: Interesting about the ‘application/octet-stream’ MIME type. I wasn’t aware of that, have always just used ‘application/force-download’ 🙂

Automatically (or more easily) reconnect to a screen session after network interruption

Does the -t option do what you want? -t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty. So: laptop> ssh -t server.com screen … Read more

Puppeteer wait for all images to load then take screenshot

There is a built-in option for that: await page.goto(‘https://www.digg.com/’, {“waitUntil” : “networkidle0”}); networkidle0 – consider navigation to be finished when there are no more than 0 network connections for at least 500 ms networkidle2 – consider navigation to be finished when there are no more than 2 network connections for at least 500 ms. Of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)