selenium-webdriver

How to send text to the search field through Selenium and Python

给你一囗甜甜゛ 提交于 2020-06-27 12:05:01
问题 I am trying to pass arguments to a search text in a HTML code using Selenium in Python: I am working on the following HTML code: </form><form class="search-box-inner"> <div class="input-container"> <input type="text" class="typeahead search-box-input left" autocomplete="off" placeholder="Search ratings, research, analysts, and more..." maxlength="900"></div> </form> The code does not have id or name. It has elements by class only. I tried the following self.driver.find_elements_by_class_name(

Selenium NoSuchMethodError

戏子无情 提交于 2020-06-27 11:22:10
问题 I am writing an automated test framework and have already written a substantial amount. However, I have come across an error which I cannot seem to fix or find a solution for. The problem occurs when selenium tries to answer a date question and select from a dropdown menu of dates. I have achieved this loads of times with no problems, but for some reason I get the error as displayed in the title. After trying to find a solution on google I decided to come here as there seems to be nothing out

How to change the User Agent using Selenium and Python

半腔热情 提交于 2020-06-26 06:58:07
问题 I am having an error when changing the web driver user agent in Python using selenium. Here is my code: import requests import json from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities driver = webdriver.Chrome(driver_path) driver.execute_cdp_cmd('Network.setUserAgentOverride', {"userAgent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'}) #Error is on line above Here

How to use find_element_by_id() in python

独自空忆成欢 提交于 2020-06-26 06:51:38
问题 I am new to selenium. I am trying to set my username in in gmail browser by using python2.6. import unittest from selenium import webdriver; from selenium import WebElement; driver = webdriver.Ie(); driver.get("http://www.gmail.com"); WebElement uname = driver.find_element(by=By,id("Username:")); uname.sendKeys("chakry.gosetty"); With the above code I am getting WebElement uname= driver.find_element(by=By,id("Username:")); SyntaxError : Invalid syntax. Please help me. Rgds, G.Chakravarthy 回答1

WebDriverException: Message: unknown error: cannot process extension #1 from unknown error: CRX verification failed: 3

人盡茶涼 提交于 2020-06-25 04:47:50
问题 Given Robot framework with Selenium is ready to execute tests in Chrome And it worked so long time When I execute the tests in Robot framework with Jenkins now I receive an error "02:05:44 WebDriverException: Message: unknown error: cannot process extension #1 02:05:44 from unknown error: CRX verification failed: 3" Is it possible the upgraded Chrome and driver is not able to use older plugins? What should I do to solve this problem? Upgrade the plugin? Upgrade the driver (might be older

WebDriverException: Message: unknown error: cannot process extension #1 from unknown error: CRX verification failed: 3

落花浮王杯 提交于 2020-06-25 04:47:11
问题 Given Robot framework with Selenium is ready to execute tests in Chrome And it worked so long time When I execute the tests in Robot framework with Jenkins now I receive an error "02:05:44 WebDriverException: Message: unknown error: cannot process extension #1 02:05:44 from unknown error: CRX verification failed: 3" Is it possible the upgraded Chrome and driver is not able to use older plugins? What should I do to solve this problem? Upgrade the plugin? Upgrade the driver (might be older

How to find button with Selenium by its text inside (Python)?

南楼画角 提交于 2020-06-24 22:50:31
问题 I have the following three buttons that I can't figure out how to grab the text that is inside of them (e.g Outliers). I tried browser.find_element_by_link_text("Outliers").click() , but got "Unable to locate element" error. How can I do it? 回答1: Another example XPath: browser.find_element_by_xpath('//button[text()="Outliers"]') 回答2: Try this XPath: "//button[@class='three-state-item btn btn-default'][.='Outliers']" . 回答3: There are two ways : By using text() method - browser.find_element_by

How to open the Default Chrome Profile through Selenium, ChromeDriver and GoogleChrome

只谈情不闲聊 提交于 2020-06-24 05:53:59
问题 I want to load a new Selenium ChromeDriver that is using Chrome as if I open Chrome from my dock (Essentially it'll have all my extensions, history, etc.) When I use the following code: ChromeOptions options = new ChromeOptions(); options.AddArgument("user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data\\"); options.AddArgument("disable-infobars"); options.AddArgument("--start-maximized"); ChromeDriver chromeDriver = new ChromeDriver(options); It loads the Chrome browser

How to open the Default Chrome Profile through Selenium, ChromeDriver and GoogleChrome

梦想与她 提交于 2020-06-24 05:53:32
问题 I want to load a new Selenium ChromeDriver that is using Chrome as if I open Chrome from my dock (Essentially it'll have all my extensions, history, etc.) When I use the following code: ChromeOptions options = new ChromeOptions(); options.AddArgument("user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data\\"); options.AddArgument("disable-infobars"); options.AddArgument("--start-maximized"); ChromeDriver chromeDriver = new ChromeDriver(options); It loads the Chrome browser

Selenium Dynamic Element Python

守給你的承諾、 提交于 2020-06-23 14:08:36
问题 Hello I am using selenium. I have to send key to this input. <input id="209f0c3d-3222-4caa-b55d-1d4463322fd4" type="email" placeholder="E-posta adresi" value="" name="emailAddress" data-componentname="emailAddress" autocomplete="email" autocorrect="off" autocapitalize="off" spellcheck="false"> <input id="8ccf12d3-e264-43b8-8bbe-70e1f3eef202" type="email" placeholder="E-posta adresi" value="" name="emailAddress" data-componentname="emailAddress" autocomplete="email" autocorrect="off"