如何处理 Robot Framework RIDE 中的 Windows 身份验证弹出窗口? [英] How to handle windows authentication popup in Robot Framework RIDE?

查看:57
本文介绍了如何处理 Robot Framework RIDE 中的 Windows 身份验证弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序的 Windows 身份验证弹出窗口与此应用程序类似 让我们知道这是否有效,我很想知道

Windows authentication popup of my application appears similar to this app https://www.engprod-charter.net/ I had used below code to handle window authentication popup in selenium using python.

from selenium import webdriver
import time
import win32com.client

driver=webdriver.Firefox()
driver.maximize_window()
driver.get('https://www.engprod-charter.net/')
shell = win32com.client.Dispatch("WScript.Shell")   
shell.Sendkeys("username")  
shell.Sendkeys("{TAB}")
shell.Sendkeys("password@123") 
time.sleep(5)
shell.Sendkeys("{ENTER}")
time.sleep(2)
driver.quit()

But since I am using python 2.7.12 for Robot Framework, it seems win32com.client is not supported there. I want to know what library I have to use in Robot Framework to handle this scenario.

I am not asking complete solution as this is not the correct approach in stackoverflow, just want a hint what should I try to handle my scenario. Thanks

解决方案

You can achieve your scenario using AutoItLibrary which handles window inputs and similar things. Basically controlling the entire GUI not just the browser.

First install AutoItLibrary for Robot Framework

  1. Make sure you have python installed for 32 bit(say python 2.7.6)
  2. Install pywin32-217.win32-py2.7.exe for 32 bit from here
  3. Download AutoItLibrary and unzip the folder
  4. Open command prompt as Administrator and go to downloaded AautoItLibrary folder folder(cd...\AutoItLibrary-1.1.post1) and then write this command and hit enter python setup.py install

Now include AutoItLibrary in Robot Framework Let us know if this works, I would be interested to know

这篇关于如何处理 Robot Framework RIDE 中的 Windows 身份验证弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆