ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Scripts  >>  VB Script
 
 


 

 
 PHP interview questions  PHP Interview Questions
 ASP interview questions  ASP Interview Questions
 CGI Perl interview questions  CGI Perl Interview Questions
 JavaScript interview questions  JavaScript Interview Questions
 VB Script interview questions  VB Script Interview Questions
 JSP interview questions  JSP Interview Questions
 Shell Script interview questions  Shell Script Interview Questions
 Python interview questions  Python Interview Questions
 Tcl interview questions  Tcl Interview Questions
 Awk interview questions  Awk Interview Questions
 AJAX interview questions  AJAX Interview Questions
 Ruby on Rails interview questions  Ruby on Rails Interview Questions
 Scripts AllOther interview questions  Scripts AllOther Interview Questions
Question
what is descriptive programming in QTP and what is
environment variable in QTP? where we store and what is its use?
 Question Submitted By :: Vinodbhaskar.m
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?
Answer
# 1
Following is taken from: sqaforums:
Link: 
http://www.sqaforums.com/showflat.php?
Cat=0&Number=220886&an=0&page=0#Post220886

Descriptive programming is nothing but a technique using 
which operations can be performed on the AUT object which 
are not present in 

the OR. For more details refer to 
http://bondofus.tripod.com/QTP/DP_in_QTP.doc
 
Is This Answer Correct ?    0 Yes 1 No
Nandhu
 
  Re: what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?
Answer
# 2
Expert view (VB)
Data table
 
Is This Answer Correct ?    0 Yes 1 No
Guest
 
 
 
  Re: what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?
Answer
# 3
descriptive programming: with out using object repository 
to execute the test script.main purpose  test execution is 
faster.enviroment variable are two types: user 
defined,system defined.
 
Is This Answer Correct ?    0 Yes 0 No
Manyam.muralireddy
 
  Re: what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?
Answer
# 4
'************************************************         
LOCATE           *****************************************

Environment.LoadFromFile "[QualityCenter] Subject\WSOP8012-
SEP 08 CL\WSOP Automation Framework\Library 
Function\Environment.ini"

GUILocate=Environment("GUILocate")
LocateSheet=Environment("LocateSheet")
RateSheet=Environment("RateSheet")
ZipCode=Environment("ZipCode")


'************************************************Locate 
Object Creation*********************************************

CheckStatus(GUILocate)
Set Main=CreateruntimeObject(LocateSheet,"Main")

	If Window(Main).Exist(0) Then
		Else
			Set Main=Alternateobject
(LocateSheet, "Main")
		End If
Set Text1=CreateruntimeObject(LocateSheet,"Text1")
Set Locate=CreateruntimeObject(LocateSheet,"Locate")
Set UCMain=CreateruntimeObject(LocateSheet,"UCMain")
Set Dialogbutton=CreateruntimeObject
(LocateSheet,"Dialogbutton")
Set Clearf =CreateruntimeObject(LocateSheet,"Clearf ")
Set LocTable =CreateruntimeObject(LocateSheet,"LocTable ")
Set DialogBox=CreateruntimeObject(LocateSheet,"DialogBox")
Set btnLoc=CreateruntimeObject(LocateSheet,"btnLoc")
Set Pg=CreateruntimeObject(LocateSheet,"Pg")
Set RateTab=CreateruntimeObject(RateSheet,"RateTab")
Set btnHelp=CreateruntimeObject(LocateSheet,"lblHelp")
Set HelpMain=CreateruntimeObject(LocateSheet,"HelpMain")
Set HelpPage=CreateruntimeObject(LocateSheet,"HelpPage")
Set lblHelpClose=CreateruntimeObject
(LocateSheet,"lblHelpClose")
Set Web=CreateruntimeObject(LocateSheet,"Web")
Set HelpWin=CreateruntimeObject(LocateSheet,"HelpWin")


			Window(Main).Activate
		  	var=Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(btnLoc).Exist
			If  var  Then
					Window(Main).Page
(Pg).ActiveX(UCMain).SwfButton(btnLoc).Click'click on the 
Locate tab
			else
		    Msgbox "Locate Screen is not opened for 
GUI Testing"
							
		ExitTest
			End If


' //////////////////////////////////////////////////////////
/////////////////////////              code starts 
here         ///////////////////////////////////////////////
////////////////////////////////

'-----------------------------------------------------------
------  Connection  Database -------------------------------
-----------------------------------------------
							
		Set conn= fgGetConnection
							
		   set recset=createobject
("ADODB.RECORDSET")
							
			  recset.CursorType = 3
							
			  qry="Select 
ObjectType,Objval,Objroproperty,Expected  from 
[Locate_GUI$]  where ObjectType is not null and 
TestStatus='Y' "
							
				recset.Open qry, conn
							
			cntre=recset.RecordCount
					

'------------------------------------------------------    
Function Calls ---------------------------------------------
-----------------------------------------------
Call LocateMenu()
Call TestSet()
Call FontCheck()
Call BusinessValidation()
Call LocateTable()
Call HelpWindowChecking()

'-----------------------------------------------------------
------  Fetch GUI Datas from Database ----------------------
--------------------------------------------------------
Public function LocateMenu()
						
	var=Window(Main).Page(Pg).ActiveX(UCMain).SwfButton
(btnLoc).Exist
							
	If  var  Then
							
		 Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(btnLoc).Click
							
			Window(Main).ActiveX
(UCMain).SwfLabel(Clearf).Click'click on thed Rate button 
of the menu
							
			 Call UpdateResult
("Locate_Menu","Passed")
							
			
							
	else
							
			Call UpdateResult
("Locate_Menu","Failed")
							
		        Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(btnLoc).Click
							
	End If
End Function

Public function TestSet()
						   
					'-------------------
--------------------------------- Checking whether  the  
webelements  are in the window   ---------------------------
--------------------------------------------------------
					For i=1 to cntre
							
		  objecttype= recset.Fields(0)
							
		  objeval= recset.Fields(1)
							
		  objpty= recset.Fields(2)
							
		  Expected= recset.Fields(3)
							
			Select Case objecttype
							
					
	Case "SwfEdit"
							
							
		Actual=  Window(Main).Page(Pg).ActiveX
(UCMain).SwfEdit("swfname:="&objeval).Getroproperty(objpty)
							
					
	Case "SwfButton"
							
							
			Actual=  Window(Main).Page
(Pg).ActiveX(UCMain).SwfButton("swfname 
path:="&objeval).Getroproperty(objpty)
							
					   Case "SwfLabel"
							
							
	 Actual=  Window(Main).Page(Pg).ActiveX
(UCMain).SwfLabel("swfname:="&objeval).Getroproperty(objpty)
							
					
	Case "SwfTable"
							
							
		Actual=  Window(Main).Page(Pg).ActiveX
(UCMain).swftable("swfname path:="&objeval).Exist
							
			End Select 			
			
							
			Call Compare(Expected, 
Actual,objeval,objpty)
							
			 recset.movenext  
					Next

End Function
'-----------------------------------------------------------
----------   Comparison Function   -------------------------
------------------------------------------------------------
---------------------------
'comparing the expected result & Acutal result

Function Compare(Expected,Actual,ObjectVal,Pty)
   
				   If Trim(Expected)=Trim
(Actual) Then

							
	 Call ResultupdateGUI
(conn,GUILocate,"Locate_Screen","Passed","Executed",ObjectVa
l,Pty)
					   Else
					   
							 
Call ResultupdateGUI
(conn,GUILocate,"Locate_Screen","Failed","Executed",ObjectVa
l,Pty)
					end if 
End Function



'-----------------------------------------------------------
---   Compare Tab Font  Function   -------------------------
----------------------------------------------------
'Clicking on other tab  and  clicking the Locate tab again 
for checking the font validation
Function FontCheck()
	 

						
	wdth=Window(Main).Page(Pg).ActiveX(UCMain).SwfButton
(btnLoc).GetROProperty("Width")

							
	var= Window(Main).Page(Pg).ActiveX(UCMain).SwfButton
(RateTab).Exist
							
	If  var  Then
							
		   Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(RateTab).Click
							
		   
							
		      	var1=Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(btnLoc).Exist
							
				If  var1  Then
							
						
	Window(Main).Page(Pg).ActiveX(UCMain).SwfButton
(btnLoc).Click
							
						
	wdth1=Window(Main).Page(Pg).ActiveX
(UCMain).SwfButton(btnLoc).GetROProperty("Width")
							
							If 
wdth=wdth1 Then
							
							
		call UpdateResult
("Locate_Tab_Font","Passed")
							
							else
							
							
		call UpdateResult
("Locate_Tab_Font","Failed")
							
							End 
If
							
				End IF
							
					
							End 
IF
End Function


'-----------------------------------------------------------
-------------  Result update on excel sheets	------------
--------------------------------------------------
'Update the excel sheet for functional related GUI 
testcases.

public Function UpdateResult(Testset,Result)
		Call Resultupdate
(conn,GUILocate,Testset,1,Result,"Executed")
END Function


'-----------------------------------------------------------
-------------  Business Validation	--------------------
------------------------------------------

Function BusinessValidation()
					   Window
(Main).ActiveX(UCMain).SwfEdit(Text1).Set ""
					       Window
(Main).ActiveX(UCMain).SwfButton(Locate).Click
   	wait(1)
							
	var = Window(Main).Dialog(DialogBox).exist(0)
                         If   var Then
							
		Window(Main).Dialog(DialogBox).WinButton
(Dialogbutton).Click
							
		Call UpdateResult
("Locate_Business_Validation","Passed")
						
	Else 
							
		Call UpdateResult
("Locate_Business_Validation","Failed")
							End 
IF
End Function

'-----------------------------------------------------------
-------------  Textbox Validation  & web service  ----------
----------------------------------------------------
'checking for  the textbox setting value & webservice error 
message

Function   LocateTable()

			i=1
			'ZipCode=fgGetData 
(conn, "L_Zipcode", GUILocate,i, "Locate_TestData") ' can 
use the environment variable for this.
			Window(Main).ActiveX(UCMain).SwfEdit
(Text1).Set ZipCode
			
			val=Window(Main).ActiveX
(UCMain).SwfEdit(Text1).GetROProperty("Text")
			If val=ZipCode Then
						
	Call UpdateResult("Locate_Textbox_Set","Passed")
			else
							 
Call UpdateResult("Locate_Textbox_Set","Failed")
			End If
    	  Window(Main).ActiveX(UCMain).SwfButton
(Locate).Click
							wait
(1)
							
	var = Window(Main).Dialog(DialogBox).exist(0)
							
		   If   var Then
							
					Window(Main).Dialog
(DialogBox).WinButton(Dialogbutton).Click
							
					Call UpdateResult
("Locate_WebService_Error","Passed")
							
			else
							
						Call 
LocateCountRows()
							
					  '  Call 
TableHeader()              'need to complete
							
			End IF
End Function
 
							
	
'**********************Count the Rows Displayed After 
Entering the Zip Code on Find Location 
Screen****'**************

Public Function LocateCountRows()
			  var=Window(Main).ActiveX
(UCMain).swftable(LocTable).RowCount
			If  var<4  Then
			   	Call UpdateResult
("Locate_Table_Values","Passed")
			else
					Call UpdateResult
("Locate_Table_Values","Passed")
			End If
End Function


'-----------------------------------------------------------
-------------   Table values	----------------------------
----------------------------------
'checking for the Table header values.
Function TableHeader()
var=Window(Main).ActiveX(UCMain).swftable
(LocTable).GetCellData(0,0)

   MsgBox var 
End Function

'-----------------------------------------------------------
-------------   Help Window	----------------------------
----------------------------------

Function HelpWindowChecking()
						Window
(Main).Page(Pg).ActiveX(UCMain).SwfButton(btnLoc).Click
						Window
(Main).Page(Pg).ActiveX(UCMain).SwfLabel(btnHelp).Click
						var=Window
(Main).SwfWindow(HelpMain).Exist(1)
                        If var Then
							
		  Call UpdateResult
("Locate_HelpWindow_Exist","Passed")
                        else
							
			   Call UpdateResult
("Locate_HelpWindow_Exist","Failed")
						End If

					valText=Window
(Main).Window(HelpWin).WebElement(Web).Object.innertext
					HelpText=fgGetData 
(conn, "L_Text", GUILocate,1, "Locate_Help_Text_Data")
					If Trim(valText)
=trim(HelpText) Then
						   Call 
UpdateResult("Locate_Help_Text","Passed")
						else
						   Call 
UpdateResult("Locate_Help_Text","Failed")
					End If

			   Window(Main).SwfWindow
(HelpMain).SwfLabel(lblHelpClose).Click
			    var1=Window(Main).SwfWindow
(HelpMain).Exist(1)
					If var1 Then
							
			  Call UpdateResult
("Locate_Help_Close","Failed")
                              else
							
			   Call UpdateResult
("Locate_Help_Close","Passed")
						End If
End Function
 
Is This Answer Correct ?    0 Yes 0 No
Hari
 

 
 
 
Other VB Script Interview Questions
 
  Question Asked @ Answers
 
in qtp we ve datatable look like excel ,if we want to extract data from excel which saved in my documet how can i get that in datatable using vb script  1
How to use Text file (Notepad) as ur data source in QTP? Can u please provide some function code for it?  1
How can I get the value of an object property or variable in another frame?  1
How do you write an SQL insert statement? HCL1
What is the differene between QTP 8.2 and QTP 9.0 and QTP 9.1,Pls give me answer ASAP. Accenture3
give me an ex. of unoverloaded method? Misys2
how to write code: to check whether the window of an Application Under Test exist or not . plz give with example  2
When importing an excel file that has several columns each with different number of rows into QTP's Global datatable, how can you count the number of rows in a particular column? McGraw-Hill2
how to get date format from system locale..format means neither long nor shor... format from system locale. i need like your date is mm/dd/yyyy formate or mm-dd-yy or with time like that. how to get.  2
How do you get the value of a combo box in Javascript? Aspire2
If anyone knows abt Test Complete material, Pls let me Know. if u have any material or any documents..... Pls mail me on this mail Id...... This is very Urgent Requirment..... for my Project.....  1
Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page CybAge1
What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>  1
How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script? Nous4
My questions is while writting descriptve programming, lets take flight reservation. Line1: systemutil.Run "D:\Program Files\Mercury Interactive\QuickTestProfessional\samples\flight\app\flight4 a.exe" dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "mercury" dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury" dialog("text:=Login").WinButton("text:=OK").click window("text:=Flight Reservation").Activate window("text:=Flight Reservation").ActiveX ("acx_name:=MaskEdBox").Type "111111" window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").Select "Frankfurt" window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").Select "London" window("text:=Flight Reservation").WinButton ("text:=FLIGHT").Click window("text:=Flight Reservation").dialog("text:=Flights Table").WinList("text:=From").Select "13536 FRA 08.00AM LON 08.45AM SR $163.00" window("text:=Flight Reservation").dialog("text:=Flights Table").WinButton("text:=OK").Click window("text:=Flight Reservation").WinEdit("attached text:=Name:").Exist window("text:=Flight Reservation").WinEdit("attached text:=Name:").Set "sagar", Now i m getting the error in the last line. it is not accepting the WinEdit("attached text:=Name:") Please do solve this urgent...! and i want to know how to insert additional properties for an object and which properties we need to select from the object spy.  3
How can I write HTML text to the window in VB Script?  2
Open Yahoo Login Page in that page Suppose i have 100 mails and i want to delete 10'th mail now give procedure & Coding For that Scenario AppLabs4
plz give ans to this in vb script........ "krishna radha" i want to print this string "Radha Krishna" like this  3
When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?  1
How to write a general script which should does the following a). If a page object is given, it should identify the page object of the corresponding page(site). b). It should identify all the links of that particular page. in QTP tool? Infosys2
 
For more VB Script Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com