Questions tagged [findelement]
180 questions
0
votes
1 answer
Unable to catch NoSuchElementException in user code
Even though my code is enclosed in a try block, I am still getting an unhandled exception,
"An exception of type OpenQA.Selenium.NoSuchElementException occurred in WebDriver.dll but was not handled in user code.
Here is the code:
try
…

Gary Spinelli
- 21
- 1
0
votes
1 answer
How to skip the first element that has the same class name and also have a "Greater-than" condition
I want to select a button which contains a number greater than 1, so i have written the following:
//*mobile-list-outcome[1]/div/div[2][number(.) > 1]
My issue is that i want to avoid the first element, because it is irrelevant, my solution was…

1 belowu
- 1
- 1
0
votes
2 answers
How to make selenium click this buttion?
click to see button
I want to make selenium click the above button so i used:
driver=webdriver.Chrome()
generate=driver.find_element_by_link_text("GENERATE EXCEL FILE TO DOWNLOAD")
generate.click()
But selenium wasnt able to find it, so how do i…

Divyam Sureka
- 1
- 1
0
votes
0 answers
Selenium findElement(By.cssSelector) for "text" that has no associated tag
Looking at HTML code with this as a web page drop list option:
"Jedi"
Attempting to use selenium css selectors to…
GRok
- 1
- 2
0
votes
1 answer
How Can I get find text of element of id , css with Java
I am trying to write a Test Scenario with Java ( using Selenium Webdriver, Junit ,testng).**
@Test
public void clickAllSee(){
page.myProfilPages().clickSeeAllWriting(); //here is going to where I want to go.
In this
Also this is my…

Uğur Aydın
- 3
- 2
0
votes
2 answers
How to find xpath for a label inside a button tag
I have a HTML like below:
the form has multiple buttons with similar html code, the button…

trickspring
- 3
- 1
0
votes
1 answer
Hover on menu and click submenu item with selenium vba
I have a menu dropdown like this. Using selenium i need to move the menu but can retreive the element by ID, xPath etc.
Cau you help plz

Yanick_T
- 1
- 1
0
votes
1 answer
The method sendKeys(String) is undefined for the type ByJava(67108964) with sendKeys method while working in VS Code using Selenium through Java
I am using Selenium writing in Java by VS Code.
I am unable to compile this line of code since there is a red line under the method sendKeys.
The line of code is:
driver.findElement(By.xpath("xpath")).sendKeys("Cologne");
Error is shown as:
The…

Farbod Alidaei
- 41
- 7
0
votes
0 answers
Unable to locate element: {"method":"css selector","selector":"a[href*='play.google.com']"}
I am trying to recreate a script done in my online class thru Udemy. There are 2 findElement commands and it appears to run the first one but i get the above error message when it looks for it. the code is exactly the same in the video but his…

WillieV
- 31
- 1
0
votes
1 answer
Selenium C# How to FindElement of image?
Im working on a project that takes a screenshot of a product image.
This image is then cropped and saved.
Here is the code
Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
using (var ms =…

Brian Minty
- 3
- 2
-1
votes
1 answer
the function find_element("xpath", ... ) can't find the element
I'm creating a bot for whatsapp, but I'm not able to search for the contact's name using the function find_element("xpath", ... )
My code:
from selenium import webdriver
import time
class WhatsappBot:
def __init__(self):
# Parte 1 - A…
-1
votes
1 answer
python Selenium find_element
I had a problem using the Selenium library.
I don't know how to use find_element. And I get an error
my code:
from selenium import webdriver
import time,selenium
driver =…

Sayhag
- 44
- 4
-1
votes
1 answer
Python find Element mismatch
I was having trouble with find elements by XPATH for a selenium script in Python.
Couldn’t understand the problem, i want to identify all of the elements that satisfy my xpath criteria.
So I simply compared the find_elements(By.XPATG, ‘//div’) to…

rev7777
- 11
- 2
-1
votes
1 answer
Python selenium : How to do a loop to find an element and click() on it multiple time until not exist?
I have this code to find element (delete product from cart), in my case i have more then one element so i need a loop de delete the products from cart one by one, this is my code but it's not working :…

FlutterLover
- 597
- 1
- 11
- 21
-1
votes
1 answer
C # Selenium problem to click a button with webdriver when there are 2 identical buttons on the page
I ask for a hand to be able to click a button with webdriver.findelement; the problem is that in the html the two buttons are identical in all properties and I cannot understand how to choose between the 2. The only field that changes is…