selenium-webdriver

Selenium Webdriver using Java - sendkeys with double slash

烂漫一生 提交于 2020-08-11 04:04:32
问题 I'm using Selenium WebDriver with Java. I'm trying to enter the text 'test' followed by 2 backslashes into a text field. When I tried the following code - driver.findElement(By.id("txtEditExcludeRegPath")).sendKeys("test\"); Only test\ is entered into the textbox. The remaining backslash is left out. Can someone help me solve this problem. Please note - Even in this post, I'm unable to view 2 consecutive slashes after 'test'. Only 1 \ gets posted. 回答1: Try the code like this ( Assuming you

org.openqa.selenium.WebDriverException: [Exception… “Component not initialized” error using GeckoDriver and Tor browser with Selenium Java

喜你入骨 提交于 2020-08-10 23:11:10
问题 I tried to run Selenium with Tor Browser but get an error. When i start my code, the Tor Browser opens and calls the url https://www.trash-mail.com/adresse-erstellen/ correctly but instead of making the last command with "sendKeys" this error occurres: Exception in thread "main" org.openqa.selenium.WebDriverException: [Exception... "Component not initialized" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: chrome://marionette/content/modal.js :: get window :: line 143

Selenium python library via docker, Chrome error failed to start: exited abnormally

天大地大妈咪最大 提交于 2020-08-10 22:54:37
问题 I am trying to run some python scripts with the selenium library from within a docker container based on miniconda/anaconda, but I keep getting this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally . I am also using a python wrapper for xvfb to avoid opening a real Chrome window. To reproduce this (from a running docker container): root@304ccd3bae83:/opt# python Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19

Element not being clicked even though it is found using Selenium

送分小仙女□ 提交于 2020-08-10 20:14:48
问题 I'm trying to click on an element (radio button) using Selenium (in Python), I can't disclose the URL because it's a private corporate intranet, but will share the relevants part of code. So basically this element is within an iframe, thus, I've used the following code to get the element: # Select the item on main DOM that will udpate the iframe contents wait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='sm20']"))).click() # Don't sleep, but only WedDriverWait... wait

Element not being clicked even though it is found using Selenium

北城余情 提交于 2020-08-10 20:13:07
问题 I'm trying to click on an element (radio button) using Selenium (in Python), I can't disclose the URL because it's a private corporate intranet, but will share the relevants part of code. So basically this element is within an iframe, thus, I've used the following code to get the element: # Select the item on main DOM that will udpate the iframe contents wait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='sm20']"))).click() # Don't sleep, but only WedDriverWait... wait

Web scraping to excel, misalignment of text (selenium, python)

半世苍凉 提交于 2020-08-10 19:16:30
问题 i'm trying to webscrape to excel, but i can't get the list of courses to actually align properly. it is just one long string on one row. i would like each row for every course to be under the proper category (see image for reference). from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import re import

Web scraping to excel, misalignment of text (selenium, python)

可紊 提交于 2020-08-10 19:15:58
问题 i'm trying to webscrape to excel, but i can't get the list of courses to actually align properly. it is just one long string on one row. i would like each row for every course to be under the proper category (see image for reference). from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import re import

How to wait until div dropdown is loaded using selenium webdriver?

别说谁变了你拦得住时间么 提交于 2020-08-10 19:14:29
问题 There are two dropdown menus on a page. When i click on First dropdown, then in second dropdown options will be automatically loaded after couple of seconds. Here comes my problem, that how can i wait for the second dropdown to load fully using selenium webdriver. <div name="ddlFruit_N" id="ddlFruit_N" class="Searchddl"> <div class="chosen-drop"> <div class="chosen-search"> <input class="chosen-search-input" type="text" autocomplete="off"> </div> <ul class="chosen-results"> <li class="active

How to point RemoteWebDriver to one of the multiple standalone docker selenium standalone chrome browsers?

二次信任 提交于 2020-08-10 18:10:25
问题 I've requirement to run test cases on separate chrome browsers running inside docker container. I've install chrome docker containers as below docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium docker run -d -p 4444:4444 -p 5901:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium I have scripts which does unique tasks like analytics testing, performance testing etc so I can't use Grid approach here. This is what I

How to point RemoteWebDriver to one of the multiple standalone docker selenium standalone chrome browsers?

僤鯓⒐⒋嵵緔 提交于 2020-08-10 18:10:18
问题 I've requirement to run test cases on separate chrome browsers running inside docker container. I've install chrome docker containers as below docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium docker run -d -p 4444:4444 -p 5901:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium I have scripts which does unique tasks like analytics testing, performance testing etc so I can't use Grid approach here. This is what I