0

Setup :python bindings for selenium 2.45.0 ,IEserver driver2.45.0(x86),python 2.7.9 ,window 7 64 bit

Problem:Trying to handle security based windows popup(OS) in a web application(input password and click ok) .

Tried 1. alert handling like this work , able to enter password

alert = driver.switch_to_alert()
alert.send_keys("1246545")

but now following doesn't work , not able to click ok or press ENETER

alert.send_keys(Keys.ENTER)
alert.send_keys("1246545"+Keys.ENTER)

2.Autoit , dont want to use it , will be last option

3.seen some solution like using Robot class

Robot rb =new Robot();
rb.keyPress(KeyEvent.VK_ENTER);

I am new to java , dont know how to import these packages in python bindings , this is how they do in selenium.

import java.awt.Robot;
import java.awt.event.KeyEvent;

want to know how to import above pacakages in python bindings for selenium , some working examples are

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
krishan
  • 131
  • 1
  • 4
  • 14

1 Answers1

0

As an alternative approach, you may like to use this special URL format to pass the credentials in the HTTP Authorization header.

http://username:password@example.com/

DRVaya
  • 443
  • 4
  • 13