Questions tagged [findelement]
180 questions
1
vote
1 answer
In Cypress, can you iterate through a table and have it perform the same functionality for each row?
I have an html/typescript frontend that contains a variable-length table with a column of action buttons, and I would like to implement a Cypress test that clicks the first button for the first row, completes a task, and then moves on to click the…

Tim
- 443
- 2
- 5
- 13
1
vote
1 answer
Does WebElement class inherits from WebDriver class in Selenium Python?
Sample code:
score_both_halves = driver.find_element_by_xpath('//label[@data-btn-radio="\'ScoreBothHalves\'"]')
score_both_halves.find_element_by_xpath()
In the second line of code I used a find_element_by_xpath() method of Webdriver class with…

Ali Haider
- 25
- 4
1
vote
3 answers
How to click a Checkbox by driver.find_element(id in Python
I am trying to automate my register/login work.
My problem is that I cannot "click" the Checkbox to accept the "Terms of use"
HTML Code of the Website:
1
vote
1 answer
Selenium Python: Find Next Element and/or Find Changing Element
Trying to find the price element of an item and return and store that attribute. The item name is clearly defined but the price varies.
Element HTML:

storyr4
- 15
- 5
1
vote
1 answer
Exception has occurred: StaleElementReferenceException Message: stale element reference: stale element not found
I want to retrieve the company from a website. If without while loop, the code can run properly. But with while loop, it gives me this error: Exception has occurred: StaleElementReferenceException Message: stale element reference: stale element not…

Ong Chan Meng
- 11
- 1
1
vote
2 answers
Unable to locate element using Selenium and Python
I'm trying to click on an accept cookies button while navigating a webpage using Selenium and Python.
I've used inspect element to find the class name of the button, and then .click() in Python to click on it. It isn't a link, but if it were…

Dallin Kump
- 37
- 6
1
vote
0 answers
How to fetch data from a cell or range of cells and put it into Sendkeys with the correct parameters and arguments. To input into a webpage box
Here is the Excel VBA code I have so far that opens Microsoft Edge:
Dim obj As New WebDriver
Sub testEdgeAuto()
obj.Start "edge", ""
obj.Get "https://www.redfin.com"
obj.FindElementByName("searchInputBox").SendKeys
For the Sendkeys, I can input…

Reyhan Nettles
- 11
- 3
1
vote
1 answer
Unable to locate and click on li element within ul list
I'm trying to click on an li element in a ul dropdown list. I want to select "Last Month" but get this error: Message: no such element: Unable to locate element
Here's my code:
def click_on(xpath):
timeout = time.time() + 30
while True:
…

Mitch Frei
- 13
- 3
1
vote
1 answer
Didn't work driver.find_elements_by_class_name() and driver.find_elements() functions
I have tried to retrieve some data from url page via Selenium, but after running function driver.find_element_by_class_name() I have obtained error message:
'WebDriver' object has no attribute 'find_element_by_class_name'
Maybe this function has…

Olga Klishchuk
- 51
- 4
1
vote
2 answers
Why does my .get_attribute('href') function return none on some links?
I am receiving the href links on some links and others returned None value.
I have the following snippet to retrieve the first 16 items on a page:
def loop_artikelen ():
artikelen = driver.find_elements(By.XPATH,…

okanmutluprogramming
- 13
- 3
1
vote
1 answer
Selenium. Python. Interact with extensions
I'm using Selenium, Chrome and Python 3.10.
I'm trying to automate login to "opensea.io" site. Site doesn't have a classic login page. It's login only through installed MetaMask wallet extension. When i click "Login" extension is open a popup and…

Massimo
- 836
- 3
- 17
- 38
1
vote
3 answers
Selenium - how to check that button is HIDDEN, without throwing error? (python)
I'm trying to do the test to learn Allure, and to assure that the test is passed, the button has to be INVISIBLE. It first clicks 1st button to make 2nd button appear. Then click 2nd button - so same (2nd button disappears). Here it is:…

michalb93
- 119
- 9
1
vote
2 answers
how to find element button in div using selenium?
I have three
and each has a button. Buttons do not have unique names. How can I find this particular button?
I want to use class=cutTooLongTest and test 'automated tester' but I don't know how.
wants to find the button marked…

juniorTestSelenium
- 13
- 3
1
vote
1 answer
How can I find a specific button on an Instagram page? What I thought would work isn't
I am trying to click the save info button you get when you first log in to an Instagram account. I can't because I keep getting ElementNotFound errors.
I tried this code and it gave this error:
chrome.find_element(By.CLASS_NAME, "_acan _acap…

TheMaestro
- 31
- 4
1
vote
1 answer
Unable to find element in Chrome browser
I'm trying to learn Selenium. The code below should open fastmail in Chrome and allow me to search for the specified web element.
I can get this to work in the Python interpreter by entering the code line by line.
from selenium import webdriver
from…

Shaye
- 179
- 13