The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1 | 2 | >> (show all)
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
InputBox Function
      #678251 - 07/12/11 05:22 AM

Hi,

i am using the InputBox finction for taking the password.But at the same time i want to mask the password so that this comes in an "*" format.
So please suggest me someting in this regard.

Thanks,

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
rajpes
Member


Reged: 07/05/11
Posts: 373
Loc: India,God's own country!
Re: InputBox Function [Re: Post_Saurabh]
      #678256 - 07/12/11 05:41 AM

Inputbox doesnt provide that facility.If you are looking for secured password,
Go to "all programs>qtp>tools>password encoder"
get your encoded password and paste it in input box

--------------------
If there is no struggle, there is no progress!

Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: rajpes]
      #678264 - 07/12/11 06:06 AM

I know about that.
I am using the IinputBoX function in an excel macro.

I want to mask the password in realtime without using the QTP password Encrytion tool.

Thanks,

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
EAGLES
stranger


Reged: 08/15/06
Posts: 603
Loc: Other side of the Computer
Re: InputBox Function [Re: Post_Saurabh]
      #678283 - 07/12/11 07:21 AM

This can't be done. only way you can mask is if you are using excel create a form in excel then mask that text field. with input box not possible.

--------------------
===========================================


Post Extras: Print Post   Remind Me!   Notify Moderator  
fenec
stranger


Reged: 08/21/06
Posts: 110
Loc: Montreal, Quebec, CANADA
Re: InputBox Function [Re: EAGLES]
      #678337 - 07/12/11 11:48 AM

I do not now exactly what you need to do , but yes you can create with excel a customized form to type a Hidden password.

thanks.


Post Extras: Print Post   Remind Me!   Notify Moderator  
MilesToGoBeforeISleep
Super Member


Reged: 09/15/10
Posts: 1887
Re: InputBox Function [Re: fenec]
      #678422 - 07/12/11 10:29 PM

So in the code u use an inputbox, retrieve the password and what u wish to do once u retrieve the input box entry.

I suggest u can use a Crypt.Excrypt method to encrypt the password retrieved from the inputbox.

str = Crypt.Encrypt(InputBox("Please provide a password"))

What is the excel operation?.

--------------------
Thanks,
Ganns!!!
<< Why are you so obsessed at finding bugs >>

Edited by Carrying_Smiles (07/12/11 11:13 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: MilesToGoBeforeISleep]
      #678451 - 07/13/11 12:16 AM

Hi,

the code str = Crypt.Encrypt(InputBox("Please provide a password")) is not working for me.

The operation is to take the password and mask the same at a realtime while entering in the InputBox.

Thanks,
Saurabh

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
MilesToGoBeforeISleep
Super Member


Reged: 09/15/10
Posts: 1887
Re: InputBox Function [Re: Post_Saurabh]
      #678458 - 07/13/11 12:47 AM

What is the error u get just post the same

--------------------
Thanks,
Ganns!!!
<< Why are you so obsessed at finding bugs >>


Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: MilesToGoBeforeISleep]
      #678466 - 07/13/11 01:37 AM

i am not getting any error but i am just not able to input the encypted password.

password should be encrypted as per the requirement.

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
chikki
Super Member


Reged: 12/12/05
Posts: 1283
Loc: USA
Re: InputBox Function [Re: Post_Saurabh]
      #678474 - 07/13/11 02:00 AM

check out the posts below
http://www.edugeek.net/forums/coding/6951-masking-password-inputbox-vbscript.html

--------------------
------------
Chikki
when things gets harder ,the harder gets going


Post Extras: Print Post   Remind Me!   Notify Moderator  
chikki
Super Member


Reged: 12/12/05
Posts: 1283
Loc: USA
Re: InputBox Function [Re: chikki]
      #678475 - 07/13/11 02:01 AM

also check using dot net factory in below post.
http://www.learnqtp.com/accept-masked-password-characters-in-input-box/

--------------------
------------
Chikki
when things gets harder ,the harder gets going


Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: chikki]
      #678498 - 07/13/11 02:56 AM

hi,

Set MyForm = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
Set MyText = DotNetFactory.CreateInstance("System.Windows.Forms.TextBox", "System.Windows.Forms")
Set MyButton = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")

is not working from macro excel code.

Thanks,

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
Juleo_2607
Advanced Member


Reged: 05/11/05
Posts: 442
Loc: Pune
Re: InputBox Function [Re: chikki]
      #678501 - 07/13/11 03:04 AM

Are you trying to take the input from the user or taking from MS Excel?

i.e. for former does the QTP script prompt the user to enter the password and user needs to enter the password?
or does the script prompt and the password is taken from somewhere e.g. excel?

--------------------
Be nice to nerds. Chances are you'll end up working for one.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: Juleo_2607]
      #678516 - 07/13/11 04:16 AM

I am trying to take the input from user only.

I am trying this through macro.

For that i am using the InputBox function but i am not getting anything to encrypt the password while putting values in the InputBox.

I wanted to encrypt the same.

thanks,

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
KrishnaD
Newbie


Reged: 02/22/07
Posts: 21
Loc: VA
Re: InputBox Function [Re: Post_Saurabh]
      #678597 - 07/13/11 08:26 AM

You can use a IE window if you like.. below is the code .. hope this helps..

Function getLoginDetails(byref GetUsername, byref GetPassword)
Dim objIE
' Create an IE object
Set objIE = Browser("micclass:=Browser").object
'Set objIE = CreateObject( "InternetExplorer.Application" )
' specify some of the IE window's settings
objIE.Document.Title = "Username/Password dialog"
objIE.ToolBar = False
objIE.Resizable = False
objIE.StatusBar = False
objIE.Width = 320
objIE.Height = 180
' Center the dialog window on the screen
With objIE.Document.ParentWindow.Screen
objIE.Left = (.AvailWidth - objIE.Width ) \ 2
objIE.Top = (.Availheight - objIE.Height) \ 1.5
End With
' Insert the HTML code to prompt for the username and password
objIE.Document.Body.InnerHTML = "<DIV>" & "Please enter your username:" _
& "<INPUT TYPE=""text"" SIZE=""15"" " _
& "ID=""Username"">" & vbCrLf _
& "</DIV>" _
& "<DIV>" & "Please enter your password:" _
& "<INPUT TYPE=""password"" SIZE=""15"" " _
& "ID=""Password"">" & vbCrLf _
& "<INPUT TYPE=""hidden"" ID=""OK"" " _
& "NAME=""OK"" VALUE=""0"">" _
& "<INPUT TYPE=""submit"" ID=""OK"" VALUE="" OK "" " _
& "OnClick=""VBScript:OK.Value=1""></DIV>"
' Wait till the OK button has been clicked


Browser("name:= Username/Password dialog").WebEdit("html id:=" & "Username").Set "XYZ"
Browser("name:= Username/Password dialog").WebEdit("html id:=" & "Password").SetSecure "asjkdhawkdjhakdjhakdhadkahkda"
Browser("name:= Username/Password dialog").WebButton("html id:=" & "OK").click
' Do While objIE.Document.All.OK.Value = 0
' wait(1)
'Loop
' Read the password from the dialog window
GetUsername = objIE.Document.All.Username.Value
GetPassword = objIE.Document.All.Password.Value
' Close and release the object
closeProcess("IEXPLORE.EXE")
openIE : syncBrowser ' close all browser(s), and open a fresh browser
Set objIE = Nothing
End Function


Thanks,
Krishna

--------------------
-Krishna Desharaju


Post Extras: Print Post   Remind Me!   Notify Moderator  
KrishnaD
Newbie


Reged: 02/22/07
Posts: 21
Loc: VA
Re: InputBox Function [Re: Post_Saurabh]
      #678598 - 07/13/11 08:30 AM

You can use a IE window if you like.. below is the code .. hope this helps..

Function getLoginDetails(byref GetUsername, byref GetPassword)
Dim objIE
' Create an IE object
Set objIE = Browser%2

--------------------
-Krishna Desharaju


Post Extras: Print Post   Remind Me!   Notify Moderator  
Sheryl_in_Winchester
Newbie


Reged: 07/15/11
Posts: 6
Re: InputBox Function [Re: Post_Saurabh]
      #679025 - 07/15/11 02:17 PM

I'm seeking same type of resolution but scripting for a PowerBuilder application. I'm going to repeat the original request, clarifying differently ...

I'm seeking a method to PROMPT for a PASSWORD from "user" who is executing the QTP script.
The InputBox command as suggeded (below) does work - however it does not utilize the "*******" mask as required for security purposes.

str = Crypt.Encrypt(InputBox("Please provide a password"))

Is there another work-around that is NOT web-based??
Thank you!!!!


Post Extras: Print Post   Remind Me!   Notify Moderator  
AnshooArora
Advanced Member


Reged: 10/27/07
Posts: 612
Loc: New Delhi, India
Re: InputBox Function [Re: Sheryl_in_Winchester]
      #679026 - 07/15/11 02:32 PM

Sheryl,

What you're trying to do with InputBox will not show the encrypted input. It will only pass the string as an encrypted one to your code. You can give DotNetFactory a try (as shown below):

Code:

Dim Form, TextBox, Point, Char

Set Form = DotNetFactory.CreateInstance("System.Windows.Forms.Form")
Set Char = DotNetFactory.CreateInstance("System.Char", 42)
Set Point = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", 20, 20)
Set TextBox = DotNetFactory.CreateInstance("System.Windows.Forms.TextBox")

TextBox.Location = Point
TextBox.PasswordChar = Char

Form.Controls.Add TextBox
Form.ShowDialog

MsgBox TextBox.Text



Just out of curiosity though, why are you doing this? Don't you think creating a form and waiting for user input can add a barrier to the script running inattentively?

--------------------
Regards,

Anshoo Arora
[AdvancedQTP] [LinkedIn] [Relevant Codes]



Post Extras: Print Post   Remind Me!   Notify Moderator  
Sheryl_in_Winchester
Newbie


Reged: 07/15/11
Posts: 6
Re: InputBox Function [Re: AnshooArora]
      #679098 - 07/17/11 09:30 AM

Thanks for your suggestion, Anshoo - i'll give it a try.

Explanation: I work with a 3-person group who is now converting WinRunner scripts to QTP due to incompatibility with PowerBuilder 12, now being installed for our Production environment. We actually used WR for almost 10 years more for production work-arounds, where scripts did repetitive processing tasks, such as letter-generation, populating databases, manually-intensive actions that WR handled BEAUTIFULLY! Our "automation environment" includes 40 blade servers dedicated to running WR scripts. We're now in a crunch to convert about 20 critical scripts to QTP and attempting to duplicate the existing script logic as much as possible. The login process is a security issue we deal with - based on the fact we're working in the Production environment. Hope this makes sense!!

Thanks again for your suggestion.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Post_Saurabh
Member


Reged: 02/23/07
Posts: 152
Loc: India
Re: InputBox Function [Re: AnshooArora]
      #679115 - 07/18/11 12:02 AM

Hi Anshoo,

The below mentioned code is not working for me from the excel macro.Have a look into same. I wanted to use that from macro for getting the password in encrypted format.

Dim Form, TextBox, Point, Char
Set Form = DotNetFactory.CreateInstance("System.Windows.Forms.Form")
Set Char = DotNetFactory.CreateInstance("System.Char", 42)
Set Point = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", 20, 20)
Set TextBox = DotNetFactory.CreateInstance("System.Windows.Forms.TextBox")
TextBox.Location = Point
TextBox.PasswordChar = Char
Form.Controls.Add TextBox
Form.ShowDialog
MsgBox TextBox.Text

--------------------
Saurabh Verma
Test Automation Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | >> (show all)



Extra information
0 registered and 52 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3386

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5