selenium-firefoxdriver

Create Dockerfile that includes Firefox and Chrome drivers for Selenium

让人想犯罪 __ 提交于 2019-12-13 00:34:56
问题 I have the following Dockerfile which will build a Selenium server FROM selenium/standalone-firefox:3.4.0-chromium FROM selenium/standalone-chrome USER root ENV NODE_ENV test RUN mkdir -p /usr/local/cdt-tests/csv-data COPY ./csv-data /usr/local/cdt-tests/csv-data USER seluser obviously the two FROM statements is incorrect => How can I create a Selenium server container that has both a Chrome driver and Firefox driver for Selenium. As far as I can tell, the selenium/standalone-firefox:3.4.0

UnhandledAlertException issue for windows pop up

纵饮孤独 提交于 2019-12-12 04:55:29
问题 Hi I am using Robot() to handle windows pop up. I am getting UnhandledAlertException at if (driver.getTitle().trim().equalsIgnoreCase(title)). There are no more open alerts and yet the exception is thrown. I tried using- dc.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); But then i get the issue for ignore- InvalidArgumentException public void VerifyTitle(String title, String URL, String UserId, String Password) throws InterruptedException,

window.scrollTo() suddenly stopped working after working fine many years into a legacy project

£可爱£侵袭症+ 提交于 2019-12-11 16:23:21
问题 This is the Firefox webdriver code: driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") which is now not working. I suspect version upgrade issue, Here are our versions: python version is 3.6 selenium version is 3.141.0 We have another project using same geckodriver and same firefox on same host and is working fine. Is there a way to print webdriver options, settings etc and compare the two scenarios ? 来源: https://stackoverflow.com/questions/57436587/window-scrollto

How to set window position of Firefox browser through Selenium using FirefoxProfile or FirefoxOptions

一笑奈何 提交于 2019-12-11 12:58:43
问题 I need to change the position of the Firefox window by creating the driver with: driver = webdriver.Firefox() I know it's possible to change the window position after the driver was created: driver.set_window_position() I can't find out how to do it using Firefox profile or options: profile = webdriver.FirefoxProfile() profile.set_preference("some_preference", my_preference) or options = Options() options.some_optins = my_options and finally: driver = Webdriver.Firefox(firefox_profile=profile

python selenium selenium.common.exceptions.StaleElementReferenceException error

喜欢而已 提交于 2019-12-11 12:48:04
问题 I have the below code from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait driver = webdriver.Firefox() driver.get("https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa") username = WebDriverWait(driver, 20).until(lambda driver : driver.find_element_by_id('appleId')) password = WebDriverWait(driver, 20).until(lambda driver : driver.find_element_by_id('pwd')) username.send_keys("xxxxxxxxxx.com") password.send_keys("xxxxxxxx") password.submit() But i

selenium/webdriver/firefox/binary.rb:134:in `path': can't modify frozen String (FrozenError)

北慕城南 提交于 2019-12-11 10:09:30
问题 I tried to run a simple google look up code in selenium and ran it on EC2 instance(Amazon Linux). I am getting an error launching Firefox and cannot understand what the error means. Ruby version - ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] selenium-webdriver version - 3.142.3 require 'selenium-webdriver' options = Selenium::WebDriver::Firefox::Options.new(args: ['-headless']) driver = Selenium::WebDriver.for(:firefox, options: options) driver.get "http://google.com" puts "Page

How to detect when all downloads finished with Selenium Webdriver and Firefox

筅森魡賤 提交于 2019-12-11 07:30:34
问题 I have an instance of FirefoxDriver that performs several operations and starts downloading several files. Those files may have various sizes and when it finishes the loop and shuts down it interrupts unfinished downloads. Is there a way I can check whether there are pending downloads and then wait until they are all complete before closing Firefox Window? This is for VB.NET but I can understand C# solutions too. Thanks! 回答1: Firefox and Chrome when downloads a file creates and intermediate

Python selenium failing on same function on 2nd time

时光毁灭记忆、已成空白 提交于 2019-12-11 05:08:25
问题 I am using page object model in unittest. There is a function "screenshot" which is passing in 1 test case but failing in another. It is really strange and since it is passing in 1 test case, i am sure about having all the dependancies. Any help would be appreciated. Code: import ... class Abc(unittest.TestCase): def setUp(self): self.xvfb = Xvfb(width=1280, height=720) self.xvfb.start() self.driver = webdriver.Firefox() self.driver.get(data.baseurl) def test_001_login(self): home_page = home

How to get rid of “allow <website> to run 'silverlight'?” alert on firefox using firefoxprofile in webdriver

坚强是说给别人听的谎言 提交于 2019-12-11 03:35:55
问题 While using robot api's to drag and drop my mouse positions are being disturbed(running firefox in full screen mode) by an alert which asks "Allow to run silverlight?". Even my webdriver api's are getting affected due to this alert as the click intended to happen on one button performs on another. I am using WebDriver to automate my scenario, combined with robot api for drag and drop. Is there a way i can set something in firefox profile so that this alert won't appear? Below image shows the

Is it possible change browser language in firefox using selenium?

丶灬走出姿态 提交于 2019-12-10 14:24:10
问题 I want to launch firefox browser in a given language in selenium automation. Can I do that? If so, please share some sample code implementation. Thanks in advance. 回答1: Set the language code in fire fox profile preference before launch the the driver as shown below. FirefoxProfile ffprofile = new FirefoxProfile(); //For japenese language ffprofile.setPreference("intl.accept_languages","ja"); driver = new FirefoxDriver(ffprofile); driver.get("https://www.google.com"); For language codes :