selenium-chromedriver

Chrome Console logs not printing Violations

懵懂的女人 提交于 2019-12-11 14:19:06
问题 I am using Selenium with Chrome Driver to crawl websites. Need to get everything that gets printed on the chrome console. Ex: I need Warning and Violation from console below chrome_debug.log doesn't contain Violations. I have tried passing arg "--verbose", "--v0", "--v1" to chrome driver, I have also tried setting LoggingPreferences loggingPreferences.enable(LogType.BROWSER, Level.ALL) with no luck. What am I missing here? 来源: https://stackoverflow.com/questions/48579511/chrome-console-logs

Drag and Drop not working with chrome webdriver in java

可紊 提交于 2019-12-11 11:46:48
问题 Enter image description here I have the following code for drag and drop an item from one location to another location By sourceLocatorDragAndDrop = By.cssSelector("#available_objects_parent tbody tr td:eq(4)"); By destinationLocatorDragAndDrop = By.cssSelector("#assigned_objects_parent table tbody"); Actions action = new Actions(webDriver); action.dragAndDrop(webDriver.findElement(sourceLocatorDragAndDrop) ,webDriver.findElement(destinationLocatorDragAndDrop)).build().perform(); This code

multithreading: chromedriver does not open url in second window

本秂侑毒 提交于 2019-12-11 11:02:58
问题 Java code in thread function: System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--no-sandbox"); chromeOptions.addArguments("--user-data-dir="+config.chromeUserDir); chromeOptions.addArguments("--profile-directory="+profile); chromeOptions.addArguments("--start-maximized"); WebDriver driver = new ChromeDriver(chromeOptions); driver.get("https://www.google.com"); and create object and start in

Selenium - How to know if next page doesn't exist?

戏子无情 提交于 2019-12-11 10:37:08
问题 I am trying to get all the services title from IBM services page and I am getting this below error: I want to know if next page exists or not . So, I may break the loop. or keep my loop to that much iterations. Here is my code: import time from selenium import webdriver from selenium.common.exceptions import NoSuchElementException def writefile(links): with open('url_list.txt', 'w') as file: file.writelines("%s\n" % link for link in links) start_url = "https://www.ibm.com/us-en/products

Chrome Headless element not visible

三世轮回 提交于 2019-12-11 09:49:29
问题 I am facing following error while trying to interact one editbox inside an iframe. Please note code is working fine, if I don't run that it in headless mode. Issue only occurs when I run in headless mode. Error: org.openqa.selenium.ElementNotVisibleException: element not visible Stacktrace: org.openqa.selenium.ElementNotVisibleException: element not visible (Session info: headless chrome=60.0.3112.113) (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform

How to make permanent settings to chrome driver

筅森魡賤 提交于 2019-12-11 09:36:59
问题 As chrome has blocked Java, Silverlight and other plugins by default now. So to make it work we need to Enable the NPAPI in chrome://flags and restart the browser to make the setting into effect,the same needs to be done in chrome driver however the setting gets lost after restarting the chrome driver, is there any way to make the permanent settings into chrome driver? 回答1: My earlier comment was wrong because desired capabilities is for non-browser specific settings like proxy address. If

Use Existing Chrome Browser with remote-debugging-port using RobotFramework

大城市里の小女人 提交于 2019-12-11 09:09:19
问题 I am trying to use existing google chrome instance using RobotFramework (SeleniumLibrary). I am starting the chrome instance like this chrome.exe --remote-debugging-port=9289 --user-data-dir="D:\gcdata" This my code in robotframework ${options}= Evaluat sys.modules['selenium.webdriver'].ChromeOptions() sys,selenium.webdriver ${prefs}= Create Dictionary debuggerAddress 127.0.0.1:9289 Call Method ${options} add_experimental_option prefs ${prefs} Create WebDriver Chrome chrome_options=${options}

Why element.click() not working in Cefsharp?

China☆狼群 提交于 2019-12-11 08:49:56
问题 I try to execute below script in Cefsharp to click on a DIV element, and not working. private static string ClickUnreads = @"(function() { let chatsEl = document.querySelectorAll('.infinite-list-item'); for (let x = 0; x < chatsEl.length; x++) { let unread = chatsEl[x].getElementsByClassName('unread'); if (unread.length > 0) { chatsEl[x].click(); } } })();"; public void ClickUnreads() { WebBrowser.ExecuteScriptAsync(ClickUnreads); } I found similar threads here that have problem similar to

How do I install chromedriver in a specific directory (/app/assets/chromedriver) on Heroku?

风流意气都作罢 提交于 2019-12-11 08:46:13
问题 Problem I have been playing around with a Python script using Selenium, which works fine locally (as I have ChromeDriver installed in the correct directory, which is assets/chromedriver ), but it does not work on Heroku. A summary of the error message I get is this: 'chromedriver' executable needs to be in PATH. No such file or directory: '/app/assets/chromedriver': '/app/assets/chromedriver' ensure chromedriver is installed at /app/assets/chromedriver Steps Taken When deploying to Heroku, I

How to accept alert that is triggered by 'get' in selenium (python, chromedriver)?

*爱你&永不变心* 提交于 2019-12-11 08:35:06
问题 I am trying to use selenium to navigate from some page to another: driver = webdriver.Chrome() driver.get("...some page...") ... # the alert does not exist yet and thus cannot be accepted driver.get("...some other page...") # the alert pops up here and blocks navigation to 'some other page' # execution never reaches here ... Now, navigating away from 'some page' triggers an alert, asking to confirm that one really wants to leave the page. This blocks execution forever. An implicit timeout was