RSelenium icon indicating copy to clipboard operation
RSelenium copied to clipboard

findElements Javascript

Open AlexFischer24 opened this issue 7 years ago • 6 comments

Hey ALL, Can anyone give me some advice by using FindElement to click some button in the website, which is under the Javascript function. I had no problem working on the html. But after

Thanks.

AlexFischer24 avatar Jun 15 '18 21:06 AlexFischer24

Can you find it with xpath or CSS? findelement("xpath", "here xpath you find by inspecting javascript button")

MislavSag avatar Jun 16 '18 06:06 MislavSag

I tried CSS it will work only if i run after one page is opened. If I run by itself, then it won't work. The error shows that Selenium message:no such element: Unable to locate element: {"method":"css selector","selector":".GrBlueTreeNodeSelected b"}

My guess was that the button I tried to make them click is in the subcategory of the main button. and the code was written in the Javascript. <type="text/javascript"> Do you know how are we supposed to solve this kind of problem?

AlexFischer24 avatar Jun 18 '18 18:06 AlexFischer24

Can you post reproducible example? Site and your code.

MislavSag avatar Jun 18 '18 18:06 MislavSag

The idea is that the code can work if i run it line by line. But if i run it together. then there will be error in certain point after login into the account. I tried to make the page load first and then run but it still doesn't work. Maybe I can try to reproduce some other public sites.

AlexFischer24 avatar Jun 18 '18 19:06 AlexFischer24

i think it's the program when i login into the website, the button is under some other body html. That's why it won't be able to find that button element. Since that element is underneath of the table in the html website somewhere.

AlexFischer24 avatar Jun 18 '18 19:06 AlexFischer24

Why don't you show which website are you talking about?

MislavSag avatar Jun 18 '18 19:06 MislavSag