Handling of security dialogs for different environments - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Handling of security dialogs for different environments (/Thread-Handling-of-security-dialogs-for-different-environments) |
Handling of security dialogs for different environments - Nishaat - 09-01-2010 Hi! Iam new to QTP. I have recently started with automation of website. Before loading the site a security dialog appears where in we have to provide username and password. This dialog appears at 2 more instances in the whole flow. The dialog title changes for every environment thats it is different for integration and staging. I have done record and play for the developemnt environment and it is working fine. Now I need to work for staging environment. Please guide me is it possible to change the existing script for integration to work on staging environment as well? If yes, please provide me the steps to change the URL and also to handle the security dialog. RE: Handling of security dialogs for different environments - PrabhatN - 09-02-2010 Hi Nishaat, You have not mentioned what are the dialog titles for different instances(please provide at least two different titles, if possible). This way we can look at the title pattern. If some part is similar for all titles we can make that part fixed and regularize the rest part. Even I had faced the same situation while I was automating a Web application. There when I was clicking on a certain link, a dialog was popped up having titles like say Employee123,Employee254 etc. So here I used something like Quote:Browser("").Dialog("title:=Employee.*").WinButton("").Click It worked fine for me. Please let me know. RE: Handling of security dialogs for different environments - Nishaat - 09-02-2010 Hi Prabhat, For integration environment we have 'Connect to dev18.sonyericsson.com' and for staging we have 'connect to stage-shop.sonyericsson.com' where in we provide a username and password and then click on OK button. Both the dialogs have different credentials. I also want to mention that i have provided the corresponding environment url in the Record and Run settings. Please can u tell me is it OK or I need to handle the URLs also seperately as we do for dialogs RE: Handling of security dialogs for different environments - PrabhatN - 09-02-2010 Hi Nishaat, I have tried accessing the two sites (said by you in earlier post) and got these two dialogs (I have attached the screenshots). I spied on both the Dialogs and the common name is "sonyericsson". And since I opened these sites from google, the Browser title in my case was Google. So you can use here the following code for both the cases Code: Browser("Creation Time:=0").Dialog("regexptitle:=.*sonyericsson.*").WinEdit("name:=nameofusernamefield").Set "UserName" Similarly you can set the Password in the password field and then click on the OK button. Instead of giving these urls from "Record and Run Settings", you can write the code Code: SystemUtil.Run "iexplore.exe","http://dev18.sonyericsson.com" Please let me know your progress RE: Handling of security dialogs for different environments - basanth27 - 09-08-2010 Have you thought about the recovery scenario ? |