selenium-chromedriver

unable to connect to chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError)

蓝咒 提交于 2019-12-18 06:55:26
问题 I get this error when I run my cucumber tests: "* Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: /opt/google/chrome/google-chrome (Selenium::WebDriver::Error::UnknownError) * " I downloaded the chromdriver, unzip it, copy it to the path (/opt/google/chrome/google-chrome ) and sudo chmod +x /opt/google/chrome/google-chrome. which google-chrome : /usr/bin/google-chrome which chromedriver : /usr/share/ruby-rvm/gems/ruby-1.9.2

What is the exact difference between “ExpectedConditions.visibilityOfElementLocated” and “ExpectedConditions.presenceOfElementLocated”

微笑、不失礼 提交于 2019-12-18 05:45:06
问题 My apologies in advance if my question sounds primary, I am very new at QA and Selenium. What is the exact difference between: wait.until(ExpectedConditions.visibilityOfElementLocated (By.xpath("//a[text()='Show advanced settings...']"))).click(); and wait.until(ExpectedConditions.presenceOfElementLocated (By.xpath("//a[text()='Show advanced settings...']"))).click(); I had a look at here but did not figure it out. 回答1: The visibilityOfElmementLocated checks to see if the element is present

Automate a button click on chrome://extensions page using selenium webdriver

吃可爱长大的小学妹 提交于 2019-12-18 05:11:10
问题 I'm trying to write an automated test that will automate the process of updating a google chrome extension. I'm not aware of another method of doing this automatically so here is what I'm currently trying to do: Open the chrome extensions page (as far as I'm aware this is just an html page unless I'm missing something). Click on the "Update extensions" button Here is what I have tried having opened the chrome extensions page: IwebElement UpdateButton = driver.findelement(By.Id("update

Automate a button click on chrome://extensions page using selenium webdriver

风流意气都作罢 提交于 2019-12-18 05:11:09
问题 I'm trying to write an automated test that will automate the process of updating a google chrome extension. I'm not aware of another method of doing this automatically so here is what I'm currently trying to do: Open the chrome extensions page (as far as I'm aware this is just an html page unless I'm missing something). Click on the "Update extensions" button Here is what I have tried having opened the chrome extensions page: IwebElement UpdateButton = driver.findelement(By.Id("update

Selenium WebDriver.ChromeDriver Nuget package installed, but not working for MSTest

这一生的挚爱 提交于 2019-12-18 04:40:43
问题 I have added the WebDriver.ChromeDriver nuget package to my solution, which contains the ChromeDriver.exe file, required for Selenium WebDriver to run automated tests using Chrome. Looking at the package contents, it just contains the file following file: tools\chromedriver.exe What this is supposed to do is add this folder to the PATH environment variable so that chromedriver.exe is accessible via the following code (this is in a UnitTest project using MSTest): [TestMethod] public void

org.openqa.selenium.SessionNotCreatedException: session not created exception

社会主义新天地 提交于 2019-12-17 23:26:58
问题 I'm trying to run some Selenium tests using the ChromeDriver, and I started getting this error: Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 42985 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7576.1","isDefault":true},"id":1,"name":"","origin":"://"} (Session

Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken: The system cannot find the file specified. (0x2)

不打扰是莪最后的温柔 提交于 2019-12-17 21:30:52
问题 I am trying to execute tests using JENKINS. Chrome Browser is getting opened but nothing is happening on the browser. am observing the below error's on JENKIN's console Can someone please help me with this: [101208:121084:0919/123709.490:ERROR:install_util.cc(603)] Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken: The system cannot find the file specified. (0x2) [101208:121084:0919/123709.490:ERROR:configuration_policy_handler_list.cc(91)] Unknown

Selenium: Not able to take complete page screenshot using aShot library

给你一囗甜甜゛ 提交于 2019-12-17 21:17:40
问题 Am trying to take the complete page screenshot both horizontally and vertically using Firefox gecko driver and aShot Library. However, the results are not as expected. Take a look: driver.get("https://google.com"); Screenshot fpScreenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver); ImageIO.write(fpScreenshot.getImage(),"JPEG",new File("FullPageScreenshot.jpg")); Looked into a lot of variants but nothing is working. Interestingly, when I try

Download files in Java, Selenium using ChromeDriver and headless mode

為{幸葍}努か 提交于 2019-12-17 20:39:46
问题 As it is still not clear for me how to download files using --headless mode in ChromeDriver - selenium [Java], add here please the example of how to do so, I try to do it like that (the file downloading works properly without --headless option): ChromeOptions lChromeOptions = new ChromeOptions(); HashMap<String, Object> lChromePrefs = new HashMap<String, Object>(); lChromePrefs.put("profile.default_content_settings.popups", 0); lChromePrefs.put("download.default_directory", _PATH_TO_DOWNLOAD

NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V

若如初见. 提交于 2019-12-17 20:33:08
问题 Getting the following error: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V when running System.setProperty("webdriver.chrome.driver", "/ocs/browserDrivers/chromedriver.exe"); //ChromeOptions chromeOptions = new ChromeOptions(); //chromeOptions.addArguments("start-maximized"); driver = new ChromeDriver(); Upgraded to selenium 3.14 and chromedriver 2.42.Not a maven project 回答1: This error