i have a problem

64 views
Skip to first unread message

吴永宁

unread,
Sep 1, 2022, 12:38:20 AM9/1/22
to Selenium Users
When I use the selenium library in python, I found that driver.find_element(By.XPATH,Xpath).click() can't click on the div element. Is there any good way to solve it?

Aaron Kahn

unread,
Sep 1, 2022, 1:05:51 AM9/1/22
to seleniu...@googlegroups.com
Check your xpath is correct or not 

On Thu 1 Sep, 2022, 10:08 AM 吴永宁, <rick...@gmail.com> wrote:
When I use the selenium library in python, I found that driver.find_element(By.XPATH,Xpath).click() can't click on the div element. Is there any good way to solve it?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2c28526c-fcb2-4f77-857d-90a75b1e90e5n%40googlegroups.com.

Ramakrishna G

unread,
Sep 1, 2022, 6:44:18 AM9/1/22
to seleniu...@googlegroups.com
javascriptexecutor concept can be used as well

Thanks and regards,
Ramakrishna G


kadambari saran

unread,
Sep 1, 2022, 6:45:48 AM9/1/22
to seleniu...@googlegroups.com

Try action class move to element if it needs scrolling 


SuperKevy

unread,
Sep 1, 2022, 10:25:34 PM9/1/22
to Selenium Users
It may be the result of an element within the div is expecting to receive the click. 

Techical Kunal

unread,
Sep 1, 2022, 10:38:28 PM9/1/22
to seleniu...@googlegroups.com
First check whether it is able to get that element or not
By using Boolean

Boolean checkEl = xpath.displayed();
If(checkEl==true) {
Print present;
}
If(checkEl== false) {
Print not present;
}

Try this out and if that is button then use linktext/partial text 

On Thu, Sep 1, 2022, 10:08 AM 吴永宁 <rick...@gmail.com> wrote:
When I use the selenium library in python, I found that driver.find_element(By.XPATH,Xpath).click() can't click on the div element. Is there any good way to solve it?

--

Techical Kunal

unread,
Sep 1, 2022, 10:57:38 PM9/1/22
to seleniu...@googlegroups.com
Also try by giving some wait/implicit wait
Reply all
Reply to author
Forward
0 new messages