'Test Gmail link
Option explicit
Dim bro, url, x, y
'Launch Google site
bro="C:\Program
Files\Internet Explorer\iexplore.exe"
url="http:\\www.google.co.in"
invokeapplication
bro&" "&url
'Test Gmail link
with
Browser("title:=Google").page("title:=Google")
x=.link("name:=Gmail").GetROProperty("url")
.link("name:=Gmail").Click
End with
y=Browser("title:=.*").GetROProperty("url")
If instr(x,y) Then
Reporter.ReportEvent micPass,"Link url
test","Correct"
else
Reporter.ReportEvent micFail,"Link url
test","Incorrect"
End If
Browser("title:=.*").Close
‘Using childobjets verifying links
Option explicit
Dim bro, url, desco, childso,
nol, i, x, y
'Launch Web tours site
bro="C:\Program
Files\Internet Explorer\iexplore.exe"
url="http://127.0.0.1:1080/WebTours/"
invokeapplication
bro&" "&url
'Find links in Web tours for
links url check
Set desco=description.Create
desco("micclass").value="Link"
Set
childso=Browser("title:=Web Tours").page("title:=Web
Tours").ChildObjects(desco)
nol=childso.count
For i=0 to nol-1 step 1
Set childso=Browser("title:=Web
Tours").page("title:=Web Tours").ChildObjects(desco)
x=childso(i).getroproperty("url")
childso(i).click
y=Browser("title:=.*").GetROProperty("url")
If instr(x,y) Then
Reporter.ReportEvent micPass,"Link
test",x&" is Correct"
else
Reporter.ReportEvent micFail,"Link
test",x&" is Incorrect"
End If
Browser("title:=.*").Back
Next
Browser("title:=Web
Tours").Close
Set childso=nothing
Set desco=nothing
‘Image types checking
Option explicit
Dim bro, url, desco, childso,
noi, i, x,nopi,noib,noil,nodi
bro="c:\program
files\internet explorer\iexplore.exe"
url="http://127.0.0.1:1080/WebTours/"
invokeapplication
bro&" "&url
Set desco=description.Create
desco("micclass").value="image"
With browser("title:=Web
Tours").page("title:=Web Tours")
Set childso=.ChildObjects(desco)
End With
noi=childso.count
nopi=0
noib=0
noil=0
nodi=0
For i=0 to noi-1 step 1
x=childso(i).getROproperty("image type")
Select Case x
Case "Plain Image"
nopi=nopi+1
Case "Image
Button"
noib=noib+1
Case "Image
Link"
noil=noil+1
case else
nodi=nodi+1
End Select
Next
print "No: of plain
image is "&nopi
print "No: of image
buttons is "&noib
print "No: of image
links is "&noil
print "No: of dynamic
image is "&nodi
browser("title:=Web
Tours").Close
set childso=nothing
set desco =nothing
‘Verify the image loaded or not
Option explicit
Dim bro, url, desco, childso,
noi, i, x, y
bro="c:\program
files\internet explorer\iexplore.exe"
url="http://newtours.demoaut.com/"
invokeapplication
bro&" "&url
Set desco=description.Create
desco("micclass").value="image"
With
browser("title:=Welcome.*").page("title:=Welcome.*")
Set childso=.ChildObjects(desco)
End With
noi=childso.count
For i=0 to noi-1 step 1
x=childso(i).getroproperty("name") 'Get
identification
y=childso(i).object.complete 'get native
If y=true Then
Reporter.ReportEvent micPass,"Image load
test",x&" loaded"
else
Reporter.ReportEvent micFail,"Image load
test",x&" not loaded"
childso(i).highlight
End If
Next
Browser("title:=Welcome.*").Close
Set childso=nothing
Set desco=nothing
‘Image comparison
Option explicit
Dim bro, url, desco, childso,
noi, i, ico, x, y
'Launch site
bro="c:\program
files\internet explorer\iexplore.exe"
url="http://newtours.demoaut.com/"
invokeapplication
bro&" "&url
'Find images
Set desco=description.Create
desco("micclass").value="image"
With
browser("title:=Welcome.*").page("title:=Welcome.*")
Set childso=.ChildObjects(desco)
End With
noi=childso.count
'create compare object
Set
ico=createobject("Mercury.Filecompare")
'comparison
For i=0 to noi-1 step 1
x=childso(i).getroproperty("src")
y="C:\image"&i&".bmp"
childso(i).capturebitmap(y)
If ico.IsEqualBin(x,y,0,1) Then
reporter.ReportEvent micPass,"Image
content test","Same"
else
reporter.ReportEvent micFail,"Image
content test","NotSame"
End If
Next
'close site
Browser("title:=Welcome.*").Close
Set ico=nothing
Set childso=nothing
Set desco=nothing
‘Using the Web application all items
Option explicit
Dim bro, url
'Launch site
bro="c:\program
files\internet explorer\iexplore.exe"
url="http://newtours.demoaut.com/"
invokeapplication
bro&" "&url
'Login
With
browser("title:=Welcome.*").page("title:=Welcome.*")
.webedit("name:=userName").set
"admin"
.webedit("name:=password").set
"admin"
.image("name:=login").click
End With
'Journey details
With
browser("title:=Find.*").page("title:=Find.*")
.webradiogroup("name:=tripType").Select("#1")
.weblist("name:=passCount").Select("2")
.weblist("name:=fromPort").Select("Paris ")
.weblist("name:=fromMonth").Select("August")
.weblist("name:=fromDay").Select("20")
.weblist("name:=toPort").Select("London ")
.weblist("name:=toMonth").Select("June")
.weblist("name:=toDay").Select("30")
.webradiogroup("name:=servClass").Select("#1")
.weblist("name:=airline").Select("#1")
.image("name:=findFlights").Click
End With
'logout
With
browser("title:=Select.*").page("title:=Select.*")
.Link("name:=SIGN-OFF").Click
End with
'close
browser("title:=Sign.*").Close
‘Get the inner text of element
Option explicit
Dim bro, url, x
'Launch site
bro="c:\program
files\internet explorer\iexplore.exe"
url="http://127.0.0.1:1080/WebTours/"
invokeapplication
bro&" "&url
'content test
With Browser("title:=Web
Tours").page("title:=Web Tours")
With .frame("name:=info")
x=.webelement("html
tag:=BLOCKQUOTE").getroproperty("innertext")
End With
End With
If instr(x,"Welcome to
the Web Tours site.") Then
reporter.ReportEvent micPass,"Content
test","Correct"
else
reporter.ReportEvent micFail,"Content
test","Incorrect"
End If
Browser("title:=Web
Tours").Close
Thank u and i wish u the same to u, keep posting u r valuable comments and suggestions..
ReplyDeleteThanks for your valuable post....
ReplyDelete{abinitio training in chennai}
I am always searching online for articles that can help. There is obviously a lot to know about this. I think you made some good points
ReplyDeleteSelenium Training in Chennai
German Classes in Chennai
French Classes in Chennai
Android Training in Chennai
Qtp training in Chennai
web designing course in chennai
This comment has been removed by the author.
ReplyDeleteThanks for your information, the blog which you have shared is useful to us.
ReplyDeletephp training center in coimbatore
php training in coimbatore
best php training in coimbatore
php course in coimbatore
best php training institute in coimbatore
feeling so good to read your informations in the blog.thanks for sharing your ideas with us and add more info.
ReplyDeletebest android development institute in bangalore
Android Training in Thirumangalam
Android Training Institutes in Vadapalani
Android Training in Padur
Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
ReplyDeleteJava Training in Chennai
Java course in Chennai
Java Training Institute in Chennai
Best Java Training Institute in Chennai
Java Training
Java Classes in Chennai
Core Java Training in Chennai
Very impressive blog! i liked it and was very helpful for me.Thanks for sharing. Do share more ideas regularly.
ReplyDeleteSpoken English Classes in OMR | Spoken English Classes in Perungudi | Spoken English in Chennai | Best Spoken English Institute in Chennai | Spoken English Classes in Siruseri | Spoken English Classes in Karapakkam | Spoken English Training center in Chennai
Awesome Post. Thanks for Sharing. Kepp updating.
ReplyDeleteTableau Training in Velachery
Tableau Courses in Velachery
Tableau Training in Tambaram
Tableau Training in Adyar
Tableau Courses in Adyar
Excellent post! keep sharing such a post
ReplyDeleteEducation
wblogin
Thanks for sharing this page, I learned a lot about android application development. It is really helpful, keep sharing.
ReplyDeleteBlue Prism Training Institute in Chennai
Blue Prism course in Chennai
Blue Prism Training in Adyar
AWS Training in Chennai
Angularjs Training in Chennai
RPA Training in Chennai
Thank you for sharing with us. It is really a valuable information.
ReplyDeleteMobile Testing Training | Mobile Application Testing Training | Mobile Apps Testing Training | Mobile Testing Course in Adyar | Mobile Testing Training in Velachery | Mobile Testing Training in Tambaram
Thanks for sharing the amazing post.It is very much informative. I am very eager to read your upcoming post.
ReplyDeletePrimavera Training in Chennai
Primavera Course in Chennai
Primavera Software Training in Chennai
Best Primavera Training in Chennai
Primavera p6 Training in Chennai
Primavera Coaching in Chennai
Good post to read
ReplyDeleteTableau training in chennai