Unable to relocate selenium element after switch frame

Viewed 22

I'm trying to click 2 buttons. so I've built this function Myfunction code

this is my situation : enter image description here

my function can find successfully the three buttons if I run them independently, I mean I hard code which button to click for example the first one referred to buttons_list[0] (green, black, and the red) but the problem happens when I would iterate the list of buttons. .

For example, I would click the first button, after that, a new frame will be shown I do some action and i will return to the result view which contains the three buttons. and after that will click the second button which is located in buttons_list1.

But the problem, the first iteration works fine if I change automatically 0 to 1. the function stop, and the web driver can't find the second button.

I guess it probably problem-related with the history of my selenium driver.

The boucle

0 Answers
Related