www.seleniumhq.org | Old Selenium website and docs | Functional Testing library
kandi X-RAY | www.seleniumhq.org Summary
kandi X-RAY | www.seleniumhq.org Summary
Old Selenium website and docs (deprecated)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of www.seleniumhq.org
www.seleniumhq.org Key Features
www.seleniumhq.org Examples and Code Snippets
Community Discussions
Trending Discussions on www.seleniumhq.org
QUESTION
I am pretty new with java with selenium and got a question regarding the NoSuchElementException:
I got the following method which should return a WebElement:
...ANSWER
Answered 2022-Mar-07 at 17:09There are two NoSuchElementException
exceptions in Java
, one is in java.util
and the other is in org.openqa.selenium
. In order to catch WebDriver
NoSuchElementException
exception you need to define the catch explicitly catch (org.openqa.selenium.NoSuchElementException e)
as following:
QUESTION
I'm using RSelenium
to do some web scraping on the website https://unicancer.sigaps.fr/.
I want to review my team sigaps points (for those who don't know, when you publish an article in a scientific magazine, you get points and the more you have points the more you will get acknowledged). I want to automatize, the collection of those data.
So i already used RSelenium
on other website and it worked, but on this specific one i can't find the html tags with those function:
ANSWER
Answered 2021-Dec-08 at 14:12We have to use switchToFrame
which is generally used for iframe
. Though there is no iframe
for this webiste we use switchToFrame
to change focus on frame
.
QUESTION
I am using rvest
to scrape news articles from the results that are given in
https://www.derstandard.at/international/2011/12/01
(and other 1000+ links on that page).
For other webpages, I used hmtl_nodes
to extract the links and created a loop to open them in order to scrape the text from each article. Here is a short version of what I'm trying to do:
ANSWER
Answered 2021-Nov-27 at 19:03There are many pop-ups on the website. You are right you have accept the cookie in the beginning.
Here is the code to get links for one date 2011/12/01
QUESTION
Now I am executing a test case but am getting a NoSuchElementException despite not using that element in my test case. Here is my implementation.
This is my page layer
...ANSWER
Answered 2021-Oct-14 at 05:26You should not declare like this,
QUESTION
I am trying to add data to a table and then asserting that data is added by collecting table data in a list but every time it throws me a StaleElement exception error, now I guess it is happening because the list is getting refreshed, so I am not sure how do I handle it.
Here is my implementation
...ANSWER
Answered 2021-Oct-04 at 09:58org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
Indicates that a reference to an element is now "stale" --- the element no longer appears on the DOM of the page. The reason for this expectation is may be your DOM
got updated or refreshed. For an example, after performing an action like click()
your DOM
may get updated or refreshed. In this time when you are trying to find an element on DOM
you will experience this error.
You have to re-find that element in updated or refreshed DOM
QUESTION
I am trying to automate the following actions:
- Launching https://www.flipkart.com > Click on Mobiles > Mouse hover on Electronics and then click on Mi.
I am getting Expection in thread "main" state Element Reference: element is not attached to the page document in the miButton() method.
Please refer the error details section.
HTML Code
Base class:
...ANSWER
Answered 2021-Apr-19 at 08:14You never find elements and then right away try to click on them. When the page is loading the elements are created, but after a few milliseconds they change their attributes, size and or location. This exception means that you found the element but as of now you "lost" it.
In order to avoid StateElementReferecneException use WebDriverWait object. You can wait for element to be visible / clickable as well as other options. Best option is to wait for the element to be clickable:
QUESTION
Here is my code:
...ANSWER
Answered 2021-Mar-20 at 19:18- Refresh page after clicking Next button each time.
- Declare table_element, tr_collection inside while.
- Declare scrape() with void return and just call scrape() without print.
- Also did some other changes in code.
QUESTION
I tried all ways that I know in Selenium web driver, but I could not resolve the Stale Element Reference Exception
. I have tried implicit wait
, explicit wait
, and fluent wait
in Selenium web driver.
My HTML looks like the screenshot below. I have to click all li options in this list.
If I loop this using foreach
, for
, or Iterator
I can click the first option but the second option throws a Stale Element Reference Exception
.
My selenium code is:
...ANSWER
Answered 2020-Nov-30 at 19:25In your code you wait for a refresh - if your DOM is changed, old references are not usable anymore (your driver tells you this). You will have to reacquire reference to LIs in the next every time after you clicked it again
QUESTION
I am trying to select a value for State and City field in https://demoqa.com/automation-practice-form form. When I try to access the state field it's throwing an error no such element: Unable to locate element.
Below are the following code snippet and the error message.
...ANSWER
Answered 2020-Aug-10 at 05:39Sometimes, I too feel the same, I will use java script executor to handles such kind of Web-elements.
QUESTION
I use Selenium to interact with Jira. My application reads time logs from Google Sheets and inserts them into Jira time logger (non-standard Jira plugin).
The problem is that Selenium returns following exeption from time to time on the stage when I try to click on the TimeLog plugin (other stages work properly)
...ANSWER
Answered 2020-Oct-15 at 10:21There are at least three things you are doing wrong:
- Using fixed sleeps.
This is not a good practice because for a good chunk of time your test is not doing anything. Use more flexible sleeps instead.
- Using fragile xpath.
//body/div[13]/div[3]/div[1]/div[3]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/small[1]
could break easily. If you can provide the HTML of the page, we could try to find a better locator.
- Potentially a short wait.
This WebDriverWait wait = new WebDriverWait(driver, 20);
is a much better approach than using Thread.sleep()
. However, 20 seconds could be a short time, depending on the network speed, for example. Try using a longer timeout.
EDIT:
The problem was solved by using a CSS selector instead of XPATH selector:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install www.seleniumhq.org
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page