selenium-firefoxdriver

How to hide FirefoxDriver (using Selenium) without findElement function error in PhantomDriver(headless browser)?

∥☆過路亽.° 提交于 2019-12-19 10:44:34
问题 I try to make hidden FirefoxDriver. According to my research I must use PhantomJSDriver but when I use PhantomJSDriver driver.FindElement statement no longer does not work. var options = new PhantomJSOptions(); options.AddAdditionalCapability("phantomjs.page.settings.userAgent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"); PhantomJSOptions p = new PhantomJSOptions(); var service = PhantomJSDriverService.CreateDefaultService();

Selenium 2.53.1 does not work on FireFox 48

人盡茶涼 提交于 2019-12-19 02:06:06
问题 I am using selenium to test our websites. When I build the project, there is an Exception :- OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000 milliseconds. Attempted to connect to the following addresses: 127.0.0.1:7055 and the problem is from the code IWebDriver driver = new FirefoxDriver(); Anybody knows how to solve this problem? 回答1: Just like the other drivers available to Selenium from other browser vendors, Mozilla has released an executable that will run

How to make Selenium script undetectable using GeckoDriver and Firefox through Python?

一曲冷凌霜 提交于 2019-12-18 09:55:24
问题 Is there any way to make your selenium script undetectable in python using geckodriver I'm using selenium for scraping. Is there any protections we need to use so websites can't detect selenium? 回答1: The fact that selenium driven Firefox / GeckoDriver gets detected doesn't depends on any specific GeckoDriver or Firefox version. The Websites themselves can detect the network traffic and can identify the Browser Client i.e. Web Browser as WebDriver controled . As per the documentation of the

How to set selenium webdriver from headless mode to normal mode within the same session?

痴心易碎 提交于 2019-12-18 08:58:47
问题 Is it possible after setting selenium webdriver to a headless mode set it back to a normal mode? from selenium import webdriver from selenium.webdriver.firefox.options import Options options = Options() options.headless = True driver = webdriver.Firefox(options=options) driver.get(http://stackoverflow.com) # set driver back to normal mode 回答1: No , it won't be possible to make Chrome operate initially in headless mode and then switch back to normal mode within the same session. When you

How to get webDriver to wait for page to load (C# Selenium project)

依然范特西╮ 提交于 2019-12-17 15:44:40
问题 I've started a Selenium project in C#. Trying to wait for page to finish loading up and only afterwards proceed to next action. My code looks like this: loginPage.GoToLoginPage(); loginPage.LoginAs(TestCase.Username, TestCase.Password); loginPage.SelectRole(TestCase.Orgunit); loginPage.AcceptRole(); inside loginPage.SelectRole(TestCase.Orgunit): RoleHierachyLabel = CommonsBasePage.Driver.FindElement(By.XPath("//span[contains(text(), " + role + ")]")); RoleHierachyLabel.Click();

WebDriverException: Message: newSession with GeckoDriver Firefox v65 and Selenium through Python 3.7

一曲冷凌霜 提交于 2019-12-17 14:55:21
问题 I am trying to use Python 3.7 + Selenium + Geckodriver + Firefox v65.0 for scrapping. New window is opening, but Firefox does not sent correct respond about session to Python and crashes after 30 seconds with an error: WebDriverException: Message: newSession In case if I downgrade Firefox to version 60.0.2 - all works correctly with all versions Geckodriver v0.22, 0.23 and 0.24. Firefox version 63.0, 65.0 and 66beta does not work, even if I try different geckodrivers from 0.22 to 0.24. System

WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type

旧街凉风 提交于 2019-12-17 09:54:34
问题 I found a similar error as mine on stackoverflow and added selenium webdriver jar files to the project using the below method : right click on project--> goto build path--> configure build path--> click on "Add external jars"--> add selenium jar files from your local machine--> click ok--> now mouseover on WebDriver in your code--> click "import webdriver"--now run your code-->you will get rid of the exception. However, I am still getting an error. Here's the error : Exception in thread "main

opening private mode in firefox through selenium

北慕城南 提交于 2019-12-13 12:39:49
问题 Actually i want to open a incognito/private mode of firefox browser through selenium , but everytime i tried it was opening firefox in normal mode. After some googling I got this code,which i used to open private mode in firefox through selenium but it is not working. FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.privatebrowsing.autostart", true); WebDriver driver = new FirefoxDriver(firefoxProfile); driver.get("http://www.google.com"); can

Not able to select the value from drop down list by using Select method in Selenium

大城市里の小女人 提交于 2019-12-13 08:37:16
问题 I not able to select the options from dropdown list by using 'Select' method. Here is my gmail account creation code. enter code here package samples; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.Select; public class SmallFunctionalities { public static void main(String[] args) throws InterruptedException { System.setProperty(

Python Selenium opens a new window on click instead of tab

被刻印的时光 ゝ 提交于 2019-12-13 03:42:59
问题 I am trying to download some files with python selenium after authentication, but when selenium clicks the file link it opens a new window and therefore it is asking for authentication again. Can I force selenium to download file without opening new window or in new tab using same auth? elementList = driver.find_elements_by_class_name("file-link") for el in elementList: el.click() Update 1: elementList = driver.find_elements_by_class_name("file-link") for el in elementList: driver.execute