selenium

handle tinymce window with python, selenium and phantomjs

China☆狼群 提交于 2021-02-07 13:44:05
问题 I have the following code for logging in on a site and post something in a forum driver = webdriver.PhantomJS() Username = "username" Password = "password" driver.get(LoginPage) WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "login"))) driver.find_element_by_name("usr").send_keys(Username) driver.find_element_by_name("pas").send_keys(Password) driver.find_element_by_id("login").click() payload = "some text" driver.get(ForumPage) WebDriverWait(driver, 10).until(EC

handle tinymce window with python, selenium and phantomjs

戏子无情 提交于 2021-02-07 13:41:42
问题 I have the following code for logging in on a site and post something in a forum driver = webdriver.PhantomJS() Username = "username" Password = "password" driver.get(LoginPage) WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "login"))) driver.find_element_by_name("usr").send_keys(Username) driver.find_element_by_name("pas").send_keys(Password) driver.find_element_by_id("login").click() payload = "some text" driver.get(ForumPage) WebDriverWait(driver, 10).until(EC

Break on exception in Chrome using Selenium

六眼飞鱼酱① 提交于 2021-02-07 13:34:20
问题 In order to investigate some Selenium test failures I would like to automatically enable the pause on exception feature in the Chrome Devtools when running the tests. There is the --auto-open-devtools-for-tabs command line option for automatically opening the DevTools pane which I am already using but apparently there is no CLI option/parameter for the autopause feature I am looking for. What I came across though is the Debugger.setPauseOnExceptions Chrome Devtools Protocol command which I

Break on exception in Chrome using Selenium

穿精又带淫゛_ 提交于 2021-02-07 13:31:04
问题 In order to investigate some Selenium test failures I would like to automatically enable the pause on exception feature in the Chrome Devtools when running the tests. There is the --auto-open-devtools-for-tabs command line option for automatically opening the DevTools pane which I am already using but apparently there is no CLI option/parameter for the autopause feature I am looking for. What I came across though is the Debugger.setPauseOnExceptions Chrome Devtools Protocol command which I

First character is missing inconstantly while sending string to the ExtJS input via sendKeys()

∥☆過路亽.° 提交于 2021-02-07 13:21:42
问题 I randomly face the issue of missing first character in the ExtJS5 input field, while sending string via sendKeys method. System info: Ubuntu 14.04 -> docker containers with selenium grid (2.48.2) Browser Firefox Code is simple. I just get input web element, wait if it's clickable (i.e. isEnabled and isDisplayed), clear and send string: wait.until(ExpectedConditions.elementToBeClickable(input)).clear(); input.sendKeys(value); input element is simple too: <input id="textfield-1455-inputEl"

First character is missing inconstantly while sending string to the ExtJS input via sendKeys()

删除回忆录丶 提交于 2021-02-07 13:20:07
问题 I randomly face the issue of missing first character in the ExtJS5 input field, while sending string via sendKeys method. System info: Ubuntu 14.04 -> docker containers with selenium grid (2.48.2) Browser Firefox Code is simple. I just get input web element, wait if it's clickable (i.e. isEnabled and isDisplayed), clear and send string: wait.until(ExpectedConditions.elementToBeClickable(input)).clear(); input.sendKeys(value); input element is simple too: <input id="textfield-1455-inputEl"

How to make selenium webdriver open in google chrome without Incognito

不想你离开。 提交于 2021-02-07 11:15:00
问题 I'm using selenium for the past 1 month. I want to create some small applications using selenium. Selenium webdriver opens an incognito window when I run it. Is there any way to make it launch in normal window(i.e which has my accounts logged in)? This is the code which I'm using : (python code in linux) chromedriver = Path to chrome driver os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) driver.get("http://www.gmail.com") 回答1: If you want to re-use

How to make selenium webdriver open in google chrome without Incognito

大兔子大兔子 提交于 2021-02-07 11:07:37
问题 I'm using selenium for the past 1 month. I want to create some small applications using selenium. Selenium webdriver opens an incognito window when I run it. Is there any way to make it launch in normal window(i.e which has my accounts logged in)? This is the code which I'm using : (python code in linux) chromedriver = Path to chrome driver os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) driver.get("http://www.gmail.com") 回答1: If you want to re-use

double slash for xpath. Selenium Java Webdriver

纵然是瞬间 提交于 2021-02-07 10:52:46
问题 I am using Selenium WebDriver. I have a doubt about the xpath. If I have the following code example: <div> <div> <div> <a> <div> </div> </a> </div> </div> </div> And I want to locate the element which is in the last <div> . I think I have 2 options with the xpath. First option is with single slash: driver.findElement(By.xpath("/div/div/div/a/div")).click(); Second option is using double slash (and here is where I have the doubt). driver.findElement(By.xpath("//a/div")).click(); Is it going to

FireFox 72.0.2 on Mac Stuck in “Remote Control” mode

纵饮孤独 提交于 2021-02-07 10:50:47
问题 72.0.2 (64-bit) on MacOS 10.14.6 (18G3020) Ran a python selenium script for automation and after that FF still shows the orange stripes bar and an icon which says "Browser is under remote control" Rebooted machine but no luck. Is there way to take out FF in normal mode now? (Not able to access saved logins in this mode) Thanks! 回答1: This did the trick. Setup FireFox sync account Create a new empty profile and make it default Restart FF with that profile Login to FF sync and get back bookmarks