2

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&amp;num_result_rows=-1&amp;submit=Query+DB&amp;current_view=-1&amp;sort_order=time_d&amp;time%5B0%5D%5B0%5D=+&amp;time%5B0%5D%5B1%5D=%3E%3D&amp;time%5B0%5D%5B2%5D=04&amp;time%5B0%5D%5B3%5D=21&amp;time%5B0%5D%5B4%5D=2018&amp;time%5B0%5D%5B5%5D=12&amp;time%5B0%5D%5B6%5D=&amp;time%5B0%5D%5B7%5D=&amp;time%5B0%5D%5B8%5D=+&amp;time%5B0%5D%5B9%5D=+&amp;time_range=day&amp;m_opt=analysis&amp;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&uacute;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
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
Rakall
  • 39
  • 5
  • Update the question with the relevant HTML of `some sort of frame appears with the form i need`, _Manual Steps_ you are trying to _Automate_, your code trials and error stack trace for a proper analysis. – undetected Selenium Apr 22 '18 at 12:39
  • I've updated the question , still don't know how to access something that hasn't loaded yet , and that doesnt even load in the main iframe. – Rakall Apr 27 '18 at 13:47

0 Answers0