This question already has answers here:
NoSuchElementException, Selenium unable to locate element
(3 answers)
Closed 4 years ago.
I have an element that selenium doesn't recognize sometimes.
I'm using implicitlyWait of 10 seconds and when i'm runing the test sometimes it passed succesfully and the element is recognized, and sometimes it failes with error "No such element".
I tried to change the wait time to 20 seconds but it dosen't matter
try using explicit wait :
WebDriverWait wait = new WebDriverWait(webDriver,60);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div/div/div/div/div[1]/div/div/a/i")));
I also faced this issue one time and I was facing this issue because I was was trying to select some option in the sub-menus using click to the main menu and then the sub-menu.
When used Actions class, the issue was resolved.
This could be an issue for you as well.
Related
This question already has answers here:
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
(1 answer)
Selenium "selenium.common.exceptions.NoSuchElementException" when using Chrome
(1 answer)
"selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element" while clicking a 'Next' button with Selenium
(1 answer)
Closed 1 year ago.
I have a problem when I use selenium in google Colab
this problem appears when I use the XPATH selector in my code, my script is running right well in the local machine, but in google Colab, it doesn't work.
that is the error:enter image description here
List item
ib/python3.7/dist-packages/ipykernel_launcher.py:37: DeprecationWarning: find_element_by_ "commands are deprecated. Please use find_element() instead".
Also when I replace XPATH_selector with find_element_by_ always the problem is stilling.
This question already has answers here:
pageLoadTimeout in Selenium not working
(2 answers)
pageLoadTimeout is not working in Selenium - Java
(2 answers)
How to make selenium to reload the desired url if it takes too long loading
(3 answers)
Closed 2 years ago.
I've got a question:
Below there is my java code for selenium to load a url in chrome browser:
chromedriver is 84.0.4147.30
Chrome version is also 84
public static int navigate(String data) {
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 30);
try {
driver.navigate().to(data);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("XPATH"));
....
}
What makes the automation:
when chrome is running the url is typed in the adreesbar and it loads the page.
But when the page is not loaded after 30 seconds, the function does not stop and aborts the test.
It waits endless.
I think it is the load sign in the page title tab that is the problem.
What can I do to abort the waiting when page is not loaded after 30 seconds?
Thanks in advance.
This question already has answers here:
Selenium - MoveTargetOutOfBoundsException with Firefox
(9 answers)
MoveTargetOutOfBoundsException problem with chromedriver version >74
(2 answers)
Closed 2 years ago.
For .perform() method of ActionChains class we are facing exception “MoveTargetOutOfBoundsException: Message: move target out of bounds” frequently in application. Majorly found for mouse actions and click at coordinate on canvas element.
Scrolling we already tried and element is center of the screen still issue is observed
we are using robotframework==3.1, robotframework-seleniumlibrary==4.3.0, chrome=83.0.4103.61, chromedriver=83.0.4103.14
When running a nightwatch.js test on a browser with a checkbox that
is not visible using the following code.
browser.moveToElement('input[id="2verificationYes"]')
.click('input[id="2verificationYes"]')
I get the following error :
An error occurred while running .click() command on ,input[id="2verificationYes"]>: unknown error: Element `element` is not clickable at point (111, 701). Other element would receive the click: `otherElement`
at process._tickCallback (internal/process/next_tick.js:64:7)
I am using
nightwatch v.1.0.19, chromedriver ^2.43.0, geckodriver ^1.16.2, selenium-server ^3.14.0
I have tried using the callback functions with each call but the result is the same. Tried to research how to scroll to an element in nightwatch, but the api's don't have that. It is my understanding the the moveToElement function is supposed to scroll to the element.
For me moveToElement is working good. I believe you are seeing error because you forgot to mentioned the Xoffset and Yoffset.
Try my below work around and let me know:
browser.moveToElement('input[id="2verificationYes"]',Xoffset,Yoffset)
.click('input[id="2verificationYes"]')
for your reference: search 'moveToElement' here
Can you try giving '0' and let me know:
browser.moveToElement('input[id="2verificationYes"]',0,0)
.click('input[id="2verificationYes"]')
Same time try giving little wait time to narrow down the issue. Good luck
I've been trying to use Selenium to test my application. I wrote the initial tests using the Selenium IDE but, when I converted the IDE tests to Selenium Webdriver tests I got errors for about half of my code! So I'm going through each of the errors trying to get the code to work.
The error I'm getting in Web Driver is
ERROR: Caught exception [Error: unknown strategy [class] for locator [class=x-tool-close]]
In Selenium IDE it had simply been Command Click and target class=x-tool-close.
Thanks,
It has been awhile since I posted this question so I cannot be sure if I am addressing what the problem was exactly, but with that said the following is what I use for the command I mentioned above.
driver.findElement(By.xpath("//img[contains(#class,'x-tool-close')]")).click();
The structure of this command is very basic. Since the id of my elements are dynamic I search by xpath. Inside the quotation marks we have said xpath. We are searching for an 'img' element whose class attribute contains 'x-tool-close'. Then we are executing the selenium webdriver command click upon that element.