Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling of security dialogs for different environments
09-01-2010, 03:19 PM
Post: #1
Handling of security dialogs for different environments

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.
Find all posts by this user
Quote this message in a reply
09-02-2010, 01:00 PM
Post: #2
RE: Handling of security dialogs for different environments
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.

Happy Testing
Prabhat
Find all posts by this user
Quote this message in a reply
09-02-2010, 01:18 PM
Post: #3
RE: Handling of security dialogs for different environments
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

(09-02-2010 01:00 PM)PrabhatN Wrote:  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.
Find all posts by this user
Quote this message in a reply
09-02-2010, 03:16 PM (This post was last modified: 09-02-2010 03:20 PM by PrabhatN.)
Post: #4
RE: Handling of security dialogs for different environments
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

Quote: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
Quote:SystemUtil.Run "iexplore.exe","http://dev18.sonyericsson.com"
SystemUtil.Run "iexplore.exe","http://stage-shop.sonyericsson.com"

Please let me know your progress


Attached File(s) Image(s)
       

Happy Testing
Prabhat
Find all posts by this user
Quote this message in a reply
09-08-2010, 07:02 AM
Post: #5
RE: Handling of security dialogs for different environments
(09-02-2010 03:16 PM)PrabhatN Wrote:  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

Quote: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
Quote:SystemUtil.Run "iexplore.exe","http://dev18.sonyericsson.com"
SystemUtil.Run "iexplore.exe","http://stage-shop.sonyericsson.com"

Please let me know your progress


Have you thought about the recovery scenario ?

Basanth
QTP On Unix- Java Way - Without Putty or Terminal Emulation
You have no idea how high I can fly...
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Closing modal dialogs for IE cowboy49 0 255 08-29-2011 09:48 AM
Last Post: cowboy49
Question Security Dialog Box vijayendra.shukla 2 726 05-06-2011 10:01 PM
Last Post: vijayendra.shukla
  Running QTP Scripts on multiple SAP Test Environments Newom85 4 2,434 08-02-2010 07:22 PM
Last Post: lotos
  How can we test Security for Webservices using webservices Addin in QTP RaghunadhKiran 0 615 04-11-2009 02:07 AM
Last Post: RaghunadhKiran

Forum Jump:


User(s) browsing this thread: 1 Guest(s)