selenium-chromedriver

Selenium can't find elements by XPath

▼魔方 西西 提交于 2020-01-07 08:55:26
问题 I'm trying to extract some odds from a page using Selenium Chromedriver, since the data is dynamic. The "find elements by XPath" usually works with these kind of websites for me but this time, it can't seem to find the element in question, nor any element that belong to the section of the page that shows the relevant odds. I'm probably making a simple error - if anyone has time to check the page out I'd be very grateful! Nordic Bet NHL Odds driver.get("https://www.nordicbet.com/en/odds#?cat=

Entering a value into a type=“hidden” field using Selenium + Python

喜夏-厌秋 提交于 2020-01-07 07:20:00
问题 I've been searching for how to solve this but can't seem to find anything that works for me. Hope someone can help. I'm on a website using python and selenium chrome browser and trying to log into a website which has the following HTML where you enter the username or email: <div> <span class="g-hdn" id="1986367435LabelSpan"><label for="1986367435">Email or username</label></span> <label for="1986367435">Email or username</label> </span> <span> <input size="40" maxlength="64" name="1986367435"

Protractor - Error: Failed: WebDriverError

点点圈 提交于 2020-01-07 05:12:08
问题 I have a protractor project that It starts and runs specs as I expect but after almost 2 minutes it starts getting this error on rest of test cases. I don't know why. It had run perfectly one week ago but now I faced that error and it doesn't give (or I can't see) any detail about error. "Error: Failed: WebDriverError at stack (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:2200:17) at buildExpectationResult (Z:\\dev\\lmw\node_modules\

Error when running Selenium Server via Nightwatch

*爱你&永不变心* 提交于 2020-01-07 04:58:26
问题 I'm attempting to run a simple test script. But I receive the following error: I have my nightwatch config file setup as so: nightwatch.conf.js module.exports = { "src_folders": [ "tests"// Where you are storing your Nightwatch e2e/UAT tests ], "output_folder": "./reports", // reports (test outcome) output by nightwatch "selenium": { "start_process": true, // tells nightwatch to start/stop the selenium process "server_path": "./node_modules/selenium-standalone/.selenium/selenium-server/2.53.1

Cannot get alert() box in Selenium WebDriver with Chrome

安稳与你 提交于 2020-01-07 04:25:09
问题 In brief Today I cannot get my code here 00 01 works to get javascript alert() box from Python with Selenium WebDriver. In full My google search on the topic gave me many results e.g. this one using EC.alert_is_present() and driver.switch_to_alert() from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC driver = webdriver.Chrome() driver.get("...some page...") WebDriverWait(driver, 5).until(EC.alert_is_present()) driver.switch

Why is add_experimental_option used in Selenium?

匆匆过客 提交于 2020-01-07 03:26:05
问题 I am trying to understand a code snippet which is quite similar to the following : from selenium.webdriver.chrome.options import Options chrome_options = Options() port_number = "127.0.0.1.8888" chrome_options.add_experimental_option("someAddressName", port_number) I tried looking for the explanation but haven't got any satisfactory answer until now. Can someone please explain the task of Options() and add_experimental_option in particular? Thank You 回答1: The way WebDriver implementations

Inconsistent results with small pixel rendering differences for the same selenium regression tests

一世执手 提交于 2020-01-06 09:01:52
问题 I am attempting to migrate the regression tests for my company's website from Selenium 2.31 and Chrome 25 to Selenium 3.14 and Chrome 75. The tests use a screenshot system where screenshots are taken in the process of the tests and compared with a baseline. In the process, I've encountered an issue where with the same tests, just across different runs, there are small differences in the rendering of small sections of the page that cause the tests to fail. The tests are run on AWS medium3

Python. Selenium. drag_and_drop error 'AttributeError: move_to requires a WebElement'

筅森魡賤 提交于 2020-01-06 08:05:38
问题 Tell me please, what am I doing wrong? I try to drag and drop through Selenium, but every time I come across an error "AttributeError: move_to requires a WebElement" Here is my code: from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains chromedriver = '/usr/local/bin/chromedriver' driver = webdriver.Chrome(chromedriver) driver.get('http://www.dhtmlgoodies.com/scripts/drag-drop-custom/demo-drag-drop-3.html') source = driver.find_elements_by_xpath('//*[

How to get all css-styles from a dom-element using Selenium, C#

℡╲_俬逩灬. 提交于 2020-01-06 08:03:34
问题 My task is to create a minimized css-file from a web-page. And so I need values from all css-properties from all dom-elements. But I don't know: How to get all computed css-styles from a specific dom-element? I have the following code: var chromeOptions = new ChromeOptions(); chromeOptions.AddArguments("headless"); var browser = new ChromeDriver(chromeOptions); var url = "https://example.com"; browser.Navigate().GoToUrl(url); var domElement = browser.FindElement(By.TagName("html")); And I

How to get all css-styles from a dom-element using Selenium, C#

房东的猫 提交于 2020-01-06 08:03:21
问题 My task is to create a minimized css-file from a web-page. And so I need values from all css-properties from all dom-elements. But I don't know: How to get all computed css-styles from a specific dom-element? I have the following code: var chromeOptions = new ChromeOptions(); chromeOptions.AddArguments("headless"); var browser = new ChromeDriver(chromeOptions); var url = "https://example.com"; browser.Navigate().GoToUrl(url); var domElement = browser.FindElement(By.TagName("html")); And I