selenium-firefoxdriver

How to open Firefox Developer Edition through Selenium

╄→尐↘猪︶ㄣ 提交于 2019-12-02 02:37:42
Following some tutorials on Selenium, I installed the geckodriver . In order to run a simple code on python to run Selenium, I have to specify this path in the command line: export PATH=$PATH:/home/xx/Downloads/geckodriver-v0.24.0-linux64 But I want Selenium to open the Developer edition I have as it contains the extension I want to test: When I sepcify the path for the Developer edition executable: export PATH=$PATH:/home/xx/Documents/ff_extension/firefox/ Then run my python script: from selenium import webdriver browser = webdriver.Firefox() Selenium still opens the geckodriver browser. Q:

Selenium FireFoxDriver Profile changing after loading firefox?

空扰寡人 提交于 2019-12-01 14:47:38
ProfilesIni profile = new ProfilesIni(); FirefoxProfile ffprofile = profile.getProfile("default");//using firefox default profile ffprofile.setPreference("permissions.default.image", 2); // this make ff to block web page images WebDriver ff = new FirefoxDriver(ffprofile); // executing firefox with specified profile ff.navigate().to("www.google.com"); // loading web page //codes for changing image blocking ??????????? How can I change the image blocking after loading some web pages? It is possible to modify preferences in flight via dev toolbar CLI but it may introduce higher overhead than

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

蹲街弑〆低调 提交于 2019-12-01 13:52:52
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(); service.SslProtocol = "any"; service.ProxyType = "http"; service.WebSecurity = false; service

Selenium FireFoxDriver Profile changing after loading firefox?

折月煮酒 提交于 2019-12-01 12:37:33
问题 ProfilesIni profile = new ProfilesIni(); FirefoxProfile ffprofile = profile.getProfile("default");//using firefox default profile ffprofile.setPreference("permissions.default.image", 2); // this make ff to block web page images WebDriver ff = new FirefoxDriver(ffprofile); // executing firefox with specified profile ff.navigate().to("www.google.com"); // loading web page //codes for changing image blocking ??????????? How can I change the image blocking after loading some web pages? 回答1: It is

How to select a drop-down menu option value using Selenium - Python

自作多情 提交于 2019-12-01 08:03:41
I need to select an element from the below drop-down menu. <select class="chosen" id="fruitType" name="fruitType"> <option value="">Select</option> <option value="1">jumbo fruit 1</option> <option value="2">jumbo fruit 2</option> <option value="3">jumbo fruit 3</option> <option value="4">jumbo fruit 4</option> <option value="5">jumbo fruit 5</option> <option value="8">jumbo fruit 6</option> </select> I have tried using this code, driver = webdriver.Firefox() driver.find_element_by_xpath("//select[@name='fruitType']/option[text()='jumbo fruit 4']").click() but it returned me with errors. How

How do I force Firefox Selenium Webdriver(Python) to accept any SSL certificates

筅森魡賤 提交于 2019-12-01 07:33:28
I'm trying to fix testing for an internal app and I don't care about security at the moment (I just want it to work). It's giving me SSL warnings which breaks the testing. Specifically Your connection is not secure/ SEC_ERROR_UNKOWN_ISSUER. I've tried both setting capabilities['acceptSslCerts'] = True and profile = webdriver.FirefoxProfile() profile.accept_untrusted_certs = True and neither works. The capabilities listed by the driver after constructing it has acceptSslCerts as false. Note I'm using Python and Firefox 47. Also I switched to using the new marionette Firefox Webdriver because

How to select a drop-down menu option value using Selenium - Python

孤街醉人 提交于 2019-12-01 07:07:30
问题 I need to select an element from the below drop-down menu. <select class="chosen" id="fruitType" name="fruitType"> <option value="">Select</option> <option value="1">jumbo fruit 1</option> <option value="2">jumbo fruit 2</option> <option value="3">jumbo fruit 3</option> <option value="4">jumbo fruit 4</option> <option value="5">jumbo fruit 5</option> <option value="8">jumbo fruit 6</option> </select> I have tried using this code, driver = webdriver.Firefox() driver.find_element_by_xpath("/

How do I force Firefox Selenium Webdriver(Python) to accept any SSL certificates

寵の児 提交于 2019-12-01 04:53:09
问题 I'm trying to fix testing for an internal app and I don't care about security at the moment (I just want it to work). It's giving me SSL warnings which breaks the testing. Specifically Your connection is not secure/ SEC_ERROR_UNKOWN_ISSUER. I've tried both setting capabilities['acceptSslCerts'] = True and profile = webdriver.FirefoxProfile() profile.accept_untrusted_certs = True and neither works. The capabilities listed by the driver after constructing it has acceptSslCerts as false. Note I

How to make Firefox open all links opened via WebDriver in the same window?

风流意气都作罢 提交于 2019-12-01 03:17:01
I want to open all links in the same window instead in new window. I tried profile.setPreference("browser.link.open_newwindow", 1) but the result is: WARNING: traffic.loop 0 error: Preference browser.link.open_external may not be overridden: frozen value=2, requested value=1 Is there an another way to open the links in the same window ? You should modify the firefox profile parameters: profile = webdriver.FirefoxProfile() profile.set_preference("browser.link.open_newwindow", 3) profile.set_preference("browser.link.open_newwindow.restriction", 0) driver = webdriver.Firefox(firefox_profile

Selenium moveByOffset doesn't do anything

杀马特。学长 韩版系。学妹 提交于 2019-12-01 00:44:53
I'm running latest selenium 2.41 with Firefox 28.0 on Linux Xubuntu 13.10 I'm trying to get FirefoxDriver to move the mouse over the page (in my test, I've used the wired webpage, that has a lot of hover-activated menus), but the moveByOffset is not doing anything noticeable to the mouse, at all: package org.openqa.mytest; import java.util.List; import java.io.File; import java.lang.*; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.*; import org.openqa.selenium