selenium-webdriver

Selenium: Element not clickable … Other Element Would Receive Click

泪湿孤枕 提交于 2021-02-17 18:57:09
问题 When running Selenium tests on my Django project, I've started to get the error: selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (61, 24.300003051757812). Other element would receive the click: <a class="navbar-brand" href="#"></a> It is odd for two reasons: First, the tests previously passed and I have not edited that part of the code base. Second, when the Selenium-driven Firefox Window pops up and I maximize the page, the tests pass. But when I let

size() option is missing using Selenium webdriver through Java

别来无恙 提交于 2021-02-17 06:48:24
问题 have been following some classes to improve my automation skills with Selenium Webdrive. I don't have size() method as an option when trying to count the numbers of links inside a page. Am I missing some jars? Import libraries? java public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "/Users/Follo/Dropbox/Chrome Drivers/chromedriver"); ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); //

How to run a Java Selenium test on an incognito Google Chrome profile

本小妞迷上赌 提交于 2021-02-17 06:43:06
问题 I hope that you're fine. I'm trying to run a certain test on a certain profile but using incognito mode here what I did, it opens the incognito WebDriver of the profile but it doesn't run the test: import org.openqa.selenium.By; import org.openqa.selenium.By.ByXPath; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; //import

How to get past a cookie agreement page using Python and Selenium?

随声附和 提交于 2021-02-17 06:09:58
问题 I am quite new to selenium and python. I am trying to navigate through a webpage (https://www.heise.de/download/) but can't get passed the cookiewall (cookie agreement page). It seems that the webdriver can't find the button to click on. The HTML code: <button type="button" backgroundcolor="[object Object]" data-testid="uc-accept-all-button" fullwidth="true" class="sc-bdnylx fmRkNf">Alles akzeptieren</button> from selenium import webdriver from time import sleep from selenium.webdriver.common

Would like to understand why switch_to_alert() is receiving a strikethrough and how to fix

拈花ヽ惹草 提交于 2021-02-17 03:29:50
问题 I'm trying to 'accept' a simple modal alert (an onscreen popup with only OK button) but switch_to_alert() in driver.switch_to_alert() is receiving a strikethrough (on pycharm). I'm using data driven testing script with OpenPyxl. I have written a condition that takes username and password from spreadsheet and adds it to login on webpage. If login is successful the code is work but the 'else' condition (ie. if fails login fails) is giving me issues due to the popup alert and I'm not sure how to

How to search a webpage using selenium by any of the keywords inputted?

我怕爱的太早我们不能终老 提交于 2021-02-17 03:25:31
问题 I am new to selenium in python. I am searching the supreme website by keywords using Xpath as such: WebDriverWait(driver, 5).until(EC.element_to_be_clickable( (By.XPATH, "//a[contains(text(),'Supreme Time Tee')]"))).click() My question is how would I search keywords for any text and skip until it finds it? For example, I struggle to grab the t shirt labeled "Dragon Tee Heather Grey" that is split into two a href link tags "Dragon Tee" and "Heather Grey". I want to be able to click either

How to avoid StaleElementReferenceException error in python selenium

≡放荡痞女 提交于 2021-02-17 02:52:10
问题 There are tons of questions about this error however none of them could be able to help my case. First i get the main url's ids that i need url = 'http://www.mosquedirectory.co.uk/browse/uk/england/london' browser = webdriver.Chrome() browser.get(url) listing = browser.find_elements_by_id('directory_listingBrowse') and I append them in to list to avoid from the error but it is not even worked hold = [] for i in listing: hold.append(i) and from these hold list I loop in for loop and this is

Condition to check if Selenium is done scrolling based on web element?

℡╲_俬逩灬. 提交于 2021-02-17 01:54:08
问题 Currently I have a script that will go to TripAdvisor and try to scrape every image in that particular filter. I was wondering what conditional I should set my if statement to in order for it to break out of the while loop and then parse the list of urls to give me clear url links to each image. I am just confused at how I can tell if I have reached the end once I have reached the last web element. The if statement is right at the end before the last printing loop. Any help is greatly

C# selenium unable to locate button through xpath

半世苍凉 提交于 2021-02-16 21:18:06
问题 I'm trying to locate an element using XPath but my code is incorrect and I'm not sure of the write syntax. I entered the code below which isn't working. IWebElement customizeButton = driver.FindElement(By.XPath("//*[@id='container']/div/div[1]/div[1]/div[2]/button[2]")); The HTML code for the element is below <button class="button u-space-ls js-customize-button button--primary " data-tooltip="{"placement":"left","title":"Customize"}" data-reactid=".0.0.0.3.3"><span class="icon icon-gear" data

selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/google-chrome unexpectedly exited with ChromeDriver Selenium Python on Linux

早过忘川 提交于 2021-02-16 21:15:53
问题 from selenium import webdriver driver = webdriver.Chrome(executable_path=r'/usr/local/bin/google-chrome') driver.get('https://www.google.co.in') print("Page Title is : %s" %driver.title) driver.quit() I receive this error: File "test.py", line 5, in <module> driver = webdriver.Chrome(executable_path=r'/usr/bin/google-chrome') File "/usr/local/python3/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__ self.service.start() File "/usr/local/python3/lib