How to access pop-up window with PAMIE

492 Views Asked by At

I want to know how to change windows using PAMIE. I am using this to log on to a website with a password, and then click through some links and screens. After I log in the next screen is a new window and can't get to that window.

from PAM30 import PAMIE
ie1 = PAMIE()

website = "my website"
ie1.navigate(website)
ie1.setTextBox("username", "my username")
ie1.setTextBox("password", "my password")
ie1.clickButton("btnSubmit")
ie1.clickLink("EREP")
ie1.changeWindow("new window name") 
ie1 = None

I get the following error:

Traceback (most recent call last):
File "C:/Python32/test3", line 13, in <module>
  ie1.changeWindow("new window name")
File "C:\Python32\lib\site-packages\PAM30.py", line 197, in changeWindow
  newWin = self.windowFind(wintext)
AttributeError: 'PAMIE' object has no attribute 'windowFind'
1

There are 1 best solutions below

0
Pengman On

I dont know about PAMIE, but I have done something like what you describe with IEC.

This snippet opens an url, clicks a link to open a popup and the graps that popup to do some stuff. After that the popup is closed.

ie = IEC.IEController()
ie.Navigate(url)
ie.PollWhileBusy()

while True:

    time.sleep(sleeptime)
    ie.ClickLink("show Fullscreen")
    ie.PollWhileBusy()
    popup = IEC.IEController(window_url='jpg')
    img =  popup.GetCurrentUrl()
    # ... do some stuff
    popup.CloseWindow()
    ie.ClickLink('Next Image ')

It might be a place to start if you are not tied to PAMIE.