hi i'm trying to make a test app in a OSSIM website I'm using selenium in python 2.7 with firefox When the website opens , i need to access an iframe , i do this like this : with this html in mind :
<iframe id="main" name="main" src="/ossim/forensics/base_qry_main.php?clear_allcriteria=1&num_result_rows=-1&submit=Query+DB&current_view=-1&sort_order=time_d&time%5B0%5D%5B0%5D=+&time%5B0%5D%5B1%5D=%3E%3D&time%5B0%5D%5B2%5D=04&time%5B0%5D%5B3%5D=21&time%5B0%5D%5B4%5D=2018&time%5B0%5D%5B5%5D=12&time%5B0%5D%5B6%5D=&time%5B0%5D%5B7%5D=&time%5B0%5D%5B8%5D=+&time%5B0%5D%5B9%5D=+&time_range=day&m_opt=analysis&sm_opt=security_events" style="visibility: visible; height: 2543px;"></iframe>
I access the frame like this
driver.switch_to.frame(driver.find_element_by_name('main'))
So far so good , now i find the button i need to click :
i need to click adv_search_button , that's simple so i do it like this :
driver.find_element_by_id('adv_search_button').click()
Here comes the issue some sort of frame appears with the form i need and don't know how to access i know that the form that appears is this :
$('#adv_search_button').click(function(){
GB_show("Búsqueda avanzada","/forensics/base_qry_form.php", 550, 900);
return false;
After much trying i gave up in trying to figure it out on my own , tried katalon automation recorder to get an idea , but i don't understand how it its doing it .( but it is working) here's the selenium code that i can't translate to python :
selenium.open("URL")
selenium.selectFrame("index=0")
selenium.click("id=adv_search_button")
selenium.selectFrame("relative=parent")
selenium.selectFrame("index=1") -< Here is where i want to be , to get the code and interact with the website.
I've tried to do :
driver.switch_to.frame("index=0")
this is the error i get.
>>> driver.switch_to.frame("index=0")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\switch_to.py", l
ine 87, in frame
raise NoSuchFrameException(frame_reference)
selenium.common.exceptions.NoSuchFrameException: Message: index=0