Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling of security dialogs for different environments
#1
Not Solved
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.
Reply
#2
Not Solved
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.
Reply
#3
Not Solved
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
Reply
#4
Not Solved
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"
SystemUtil.Run "iexplore.exe","http://stage-shop.sonyericsson.com"

Please let me know your progress


Attached Files Image(s)
       
Reply
#5
Not Solved
Have you thought about the recovery scenario ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem in Handling Security Warning Window yasseema 3 5,081 06-06-2013, 10:11 AM
Last Post: vinod123
  Use same QTP script for 2 different environments flexdev 1 2,725 05-21-2012, 09:44 AM
Last Post: sshukla12
  Closing modal dialogs for IE cowboy49 0 2,419 08-29-2011, 09:48 AM
Last Post: cowboy49
Question Security Dialog Box vijayendra.shukla 2 3,435 05-06-2011, 10:01 PM
Last Post: vijayendra.shukla
  Running QTP Scripts on multiple SAP Test Environments Newom85 4 8,041 08-02-2010, 07:22 PM
Last Post: lotos

Forum Jump:


Users browsing this thread: 1 Guest(s)