General Important scripts1

1) Open a msgbox and close it in a specified time
set messagebox = createobject("wscript.shell")
messagebox.popup"message",time in sec,"Title of message box (Optional)"

2) Find all the child objects with a specified text
Set oDes=description.Create()
oDes("micclass").value="WebElement"
oDes("html tag").value="FONT"
set AAA = Browser("name:=xxx").page("title:=yyy").ChildObjects(oDes)
cnt=AAA.count
For i= 0 To cnt-1
BBB= AAA.item(i).getroproperty("outertext")
If instr(1,BBB,"$") Then 'Displays all texts starting with $
print "Text starting with $ is= "& BBB
End If
Next

3) If u find text field is not enable until you send some keystroke to web edit, in that case we have to send key stroke to webedit by creating it as:
Set ws = createobject("wscript.shell")
Browser(brw).page(pge).webedit(usname).click
ws.sendkeys"username"

4) Find the properties of a text (Eg: Link)
Set a = Browser(browser).page(page).link(link_prop)
Set b = a.object
Color = b.currentStyle.color
BackgrColor = b.currentStyle.backgroundColor
FontSize = b.currentStyle.fontSize
FontStyle = b.currentStyle.fontStyle
FontFamily = b.currentStyle.fontFamily
FontWeight = b.currentStyle.fontWeight

Msgbox Color & vbnewline & BackgrColor & vbnewline & FontSize & vbnewline &FontStyle & vbnewline& FontFamily &vbnewline & FontWeight

5) Find the number of unread messages in inbox of Gmail using simple regular expression
systemutil.Run "https://www.gmail.com"
Set a =browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google")
browser("name:=Gmail: Email from Google").sync
a.webedit("name:=Email").Set "sunilkumar284"
a.webedit("name:=Passwd").SetSecure "password"
a.webcheckbox("name:=PersistentCookie").click
a.webbutton("name:=Sign in").click

mails = Browser("name:=Gmail - Inbox *.*").page("title:=Gmail - Inbox *.*").link("name:=Inbox*.*").GetROProperty("outertext")
msgbox (mails)