Quality Testing

Quality is delighting customers

I have created in webpage (ASP.net #C sharp).Its path is http://localhost:3287/WebSite7/Default.aspx" .Its Title is Rao Editing1
Now I want to check is this applcation launch sucessfully or not.I wriiten below mentioned script in QTP

"SystemUtil.Run "C:\Program files\Internet Explorer\IEXPLORE.EXE", "http://localhost:3287/WebSite7/Default.aspx"
Wait (10)
Browser_Name = Browser("Rao Editing1").GetROProperty("title")
If Browser_Name ="Rao Editing1" Then
Result = "Application Launched Successfully"
Msgbox Result
Else
Result ="Application not Launched"
Msgbox Result
End If


Its give me below mentioned error
"The "Rao Editing1" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object."

So can anybody help me how can i resolve this error .
Thanks

Views: 327

Reply to This

Replies to This Discussion

Hi you can use this code

if Browser("title:=Rao Editing1").Page("title:=Rao Editing1").Exist then

msgbox "Application Launched Successfully"

end if

Crt me if I am wrong

Above code is fine but here is much better one:

Browser("creationtime:=0").Exist

 Hi Renu,

              You need to add browser as a object in the object repository then,you can write

Browser_Name = Browser("Rao Editing1").GetROProperty("title")
If Browser_Name ="Rao Editing1" Then
Result = "Application Launched Successfully"
Msgbox Result

  Similarly,You need to add your home page("Default.aspx") of application into OR.By doing this,you can put validation on home page of application(This will help you to know whether your application is working fine) by writing script as:

Page_Name = Browser("Rao Editing1").Page("Default.aspx").GetROProperty(title)
If  Page_Name ="Default.aspx" Then 
Result = "Application Launched Successfully"
Msgbox Result 

Else

Result ="Application not launched/Application is not working fine"

Msgbox Result

End if 

  I will suggest you,it will be best way of working by validation your homepage(Default.aspx) of your application.   

Thanks Yogesh,

Issue has been resolved as you mentioned .

There are 2 ways to resolve your issue Renu,

1.Add the required object information in to Object repository

2.By using Descriptive programming ,So that object information can provide in script itself

Based on situation and available resources we can choose any one of the above.

If you are choosing DP as your option,The code will be as sasi code

if Browser("title:=Rao Editing1").Page("title:=Rao Editing1").Exist then

msgbox "Application Launched Successfully"

end if

 

 

Hi Suresh,

I used this but its giving error msg that 

"

SystemUtil.Run "C:\Program files\Internet Explorer\IEXPLORE.EXE", "http://localhost:3287/WebSite7/Default.aspx"
Wait (1)
if Browser("title:=Rao Editing1").Page("title:=Rao Editing1").Exist then
msgbox "Application Launched Successfully"
end if

Same code i ran for google.Its working fine 

SystemUtil.Run "C:\Program files\Internet Explorer\IEXPLORE.EXE", "http://www.google.co.in/"
Wait (1)
if Browser("title:=Google").Page("title:=Google").Exist then
msgbox "Application Launched Successfully"
end if

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service