ranga


{ City } hyderabad
< Country > india
* Profession *
User No # 108346
Total Questions Posted # 0
Total Answers Posted # 6

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 2
Users Marked my Answers as Wrong # 1
Questions / { ranga }
Questions Answers Category Views Company eMail




Answers / { ranga }

Question { IBM, 3434 }

hi, i am trying to capture "web element" names in a web page, and i written the code like this,,
with Browser("title:=")
with .page("")
.webelement("htmltag:=...").getroproperty("innertext")
end with
end with
////////////////////////////////////////////////////////////////////////////////////
QTP RETURN ERROR like this:
" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object"
ok fine , i need to search another property other than "index"
i use all the properties like class,text,innerhtml,innertext,visible=true,x , y,abs x ,abs y...but qtp returns error .....
in this webpage index is difficult to find? how to solve


Answer

with Browser("title:=")
with .page("")
.webelement("innertext:=.*innertext value .*","index:=0").getroproperty("innertext")
end with 
end with

Is This Answer Correct ?    0 Yes 0 No

Question { 4996 }

if there is two login button in your page, how you know that
this login button is correct for login .


Answer

But before going operate the button check whether that button is enabled or disabled


set objbutton=Description.Create
objbutton("micclass").value="Webbutton"
objbutton("name").value="login"

set childs = B().P().childobjects(objbutton)

for i=0 to childs.count-1 step 1

if Broser("BR").page("PG").webbutton("index:="&i).getroproperty("Enabled") then
Broser("BR").page("PG").webbutton("index:="&i).Click
end if

Next

Is This Answer Correct ?    0 Yes 0 No


Question { Bosch, 2857 }

suppose take one row in a row 16 columns is there.in 16
columns 16 numbers is there.but i want to get each 3 column
number.o/p :5 columns get in 16 columns means. so can
anybody write this function? plz send if u know the answer.


Answer

c=B().P().WT().getroproperty("cols")

for i=2 to c-1 step 3

temp = B().P().WT().getcelldata(rownumber , i)

msgbox temp

Next

Is This Answer Correct ?    1 Yes 1 No

Question { iCreate, 3692 }

if we can find the status of script in qtp that either it's
pass or fail then why we need to put this status on
different excel file or log file in hybrid framework .please
let me know asap
thanks


Answer

If you run a single test script it is easy for you go there and find the status.

If you go for Batch Run in Regression testing it is difficult to go to each script and find the status.Because of this reason excel files used.Get the status of each script at the end of execution and put it excel file.

It is easy to Analyze the Batch execution results.

Is This Answer Correct ?    0 Yes 0 No

Question { 3997 }

Hi,

I have a login page. To login in that page I need to have a
valid username and password, which is stored in database. I
imported that table to my DataTable in QTP (Global sheet).
Now I need to write a code in qtp so that I can login only
with valid username and data.

my condition is : I want to get username and password from
inputbox(which i did) and click on login button- which should
verify the datatable for username and password and if value
is present only then lofin else stop the testing.

DataTable contains columns : LoginName and Password

Code:

Rowcount= DataTable.GetSheet("Global").GetRowCount
msgbox "RowCount= " &RowCount,1
CurrentRow= DataTable.SetCurrentRow(1)

Do
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$UserName$ctl").Set DataTable("LoginName",1)
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$Password$ctl").Set DataTable("Password",1)
Browser("").Page("").Frame("Frame").Link("Login").Cli
ck
CurrentRow=CurrentRow+1
Loop Until CurrentRow>Rowcount

Can anyone help?

Thanks,
Priya


Answer

Hi,


May be you missed the syntax
 you written---DataTable("LoginName",1)

DataTable.Value("LoginName",1)


Please check once whether it will solve your problem.

Is This Answer Correct ?    0 Yes 0 No

Question { 9026 }

If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.


Answer

set Objects = description.create
Objects("micclass").value = "Browser"

set Childs = Desktop.childobjects(Objects)

for i=0 to Childs.count-1 step 1

Browser("index:="&i).close

next

if Browser("index:=0").exist then

msgbox "Fail"

Else

msgbox "Pass"

End if

Is This Answer Correct ?    1 Yes 0 No