Error switching to a frame

Hi,

I am using switchto().frame(“frameid”) to switch to a frame in a page. It is working correctly but when I add same code in for loop and try to run the code it is working for 2-3 loops and then throwing Error as "no frame Id found ". Can anyone help me on this? Thank you.

Regards,
Aswitha.

Hi Aswitha, can you share the web page you work with and the frame you need to switch to?

Hi Asha,

Thank you for your reply. But I am working in a project website. So I may not able to share the webpage. But the same frame ID is working for 2-4 times in loop. I am not sure why it is failing sometimes. Can you suggest anything on this?

Regards,
Aswitha.

Hi Alesia Shapnika,

Sorry I misspelled your name.

Regards,
Aswitha.

@aswitha_lebur is the frame id always the same? perhaps, it is dynamic.

Frame ID is always same. It is working for 2-4 times in loop and its failing in last step mostly.

Regards,
Aswitha.