selenium-chromedriver

Opening more than 9 sessions with Selenium

放肆的年华 提交于 2019-12-11 05:17:47
问题 I am trying to use Selenium to visit a website with a few dozen sessions at a time, but whenever I try and setup more than 9 sessions, it says "chromedriver.exe is not responding" and the sessions start closing themselves. Here is my code: from selenium import webdriver import time url = "website URL" amount = 36 def generateBrowsers(): for x in range(0, amount): driver = webdriver.Chrome(executable_path="C:/Users/user/Documents/chromedriver_win32/chromedriver.exe") driver.get(url) time.sleep

Selenium alert authentification

China☆狼群 提交于 2019-12-11 05:07:53
问题 I am trying to access a website located on my localhost. When I navigate to it, an alert appears and I have to authenticate, but when I use the method "authenticateUsing", it shows me that it does not exist. Can anyone help me? System.setProperty("webdriver.chrome.driver","C:\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.navigate().to("http://localhost:8015/thing/Home"); String username = "a"; String password = "bbbbb"; WebDriverWait wait = new WebDriverWait(driver, 10);

Python Selenium Testing. How can I extract the Auto Suggestions from search box on Google Home Page?

亡梦爱人 提交于 2019-12-11 05:04:13
问题 I am doing some auto testing Python + Selenium.Is there any way to check suggestion box in google for example using selenium. Something like I would like to now that suggestion table is revealed when auto test put google in search bar. 回答1: try the following code: suggestions = driver.find_elements_by_css_selector("li[class='sbsb_c gsfs']") for element in suggestions: print(element.text) Iterate through all elements using for loop, and call text on WebElement. 回答2: To extract the Auto

How to download pdf files using selenium java?

限于喜欢 提交于 2019-12-11 04:29:08
问题 Trying to download pdf files using selenium java. I also tried enabling the content settings of the browser but whenever the selenium script opens the browser (chrome/Mozilla), it opens with the default setting i.e. "Download PDF files instead of automatically opening them in Chrome" as disabled while my actual browser setting is enabled. Is there a way to set WebDriver capabilities(which opens as a result of selenium script execution) for the same? Another way, I tried to form an input

rselenium | get youtube page source

独自空忆成欢 提交于 2019-12-11 04:26:50
问题 Why is the page source of youtube.com not scrapeable? I tried the following (using phantomjs as well as chrome with a selenium server) library(RSelenium) pJS <- phantom(pjs_cmd = ...) Sys.sleep(5) # give the binary a moment remDr <- remoteDriver(browserName = 'phantomjs') remDr$open() remDr$navigate("https://www.youtube.com/") remDr$getTitle()[[1]] # [1] "YouTube" remDr$getPageSource() Returns: Error in fromJSON(content, handler, default.size, depth, allowComments, : invalid JSON input 回答1:

Selenium error when deleting cookies

我只是一个虾纸丫 提交于 2019-12-11 04:24:51
问题 Has anyone encountered this issue when Selenium tries to delete cookies? After months of working fine and not changing anything, we're suddenly hitting this error when running tests: System.InvalidOperationException : unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"(FE3E5C7422F34F92AF238C0A8EBA89BF)","isDefault":true},"id":1,"name":"","origin":"://"} (Session info: chrome=64.0.3282.167) (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3

How do I add arguments to ChromeDriver while also using mobile emulation (Java)?

折月煮酒 提交于 2019-12-11 04:07:31
问题 I'm using ChromeDriver with my JUnit/Selenium tests. I have tests for both desktop and mobile. For my desktop tests I specify several Arguments to ensure test results are consistent, as so: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions desktopOptions = new ChromeOptions(); desktopOptions.addArguments("start-maximized", "disable-extensions", "test-type", "no-default-browser-check", "ignore-certificate-errors"); capabilities.setCapability(ChromeOptions

“ java.lang.IllegalStateException: The driver is not executable” error is coming when TestNG test cases run on Jenkins install on ubuntu 14.1

亡梦爱人 提交于 2019-12-11 03:52:48
问题 "java.lang.IllegalStateException: The driver is not executable" error is coming when TestNG test cases run on Jenkins install on ubuntu 14.1. As if Chromedriver is not starting on jenkin installed on ubuntu, Same configuration tried on jenkin install on Window os, works fine.Please provide me any solution if any. Console Ouput : run: [testng] org.testng.TestNGException: [testng] Cannot instantiate class TestCase.NewsArticles_Section_TC [testng] at org.testng.internal.ObjectFactoryImpl

Chrome not rendering fonts when opened in terminal or run by webriver

非 Y 不嫁゛ 提交于 2019-12-11 02:35:11
问题 Google Chrome does not render fonts when run with selenium and chromedriver. Code see below. The same issue occurs when opening chrome from the terminal with /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome It looks like this: Screenshot of chrome not showing fonts with google start page opened. Setup: Google Chrome Version 67.0.3396.99 macOS sierra, Version 10.12.6 "chromedriver": "^2.40.0" (package.json) "selenium-webdriver": "^4.0.0-alpha.1" node.js v9.11.1 This is my code

Not able to open Chrome headless from Selenium

风格不统一 提交于 2019-12-11 01:48:49
问题 I am using maven here.Here is my Selenium code: DesiredCapabilities capb = DesiredCapabilities.chrome(); capb.setCapability("chrome.binary","/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); ChromeOptions options = new ChromeOptions(); options.addArguments("--headless","--disable-gpu", "--no-sandbox","--remote-debugging-port=9222"); capb.setCapability(ChromeOptions.CAPABILITY, options); System.setProperty("webdriver.chrome.driver","/Users/nitinkumar/TEST/chromedriver"); try{