Micro Focus QTP (UFT) Forums
unable to send email - descriptive programming - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: unable to send email - descriptive programming (/Thread-unable-to-send-email-descriptive-programming)



unable to send email - descriptive programming - vimal singh - 12-21-2009

Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = True
IE.Navigate "www.hotmail.com"
wait (2)
Browser("name:=Sign In").Page("title:=Sign In").WebEdit("name:=login").Set "vimalsingh2k@hotmail.com"
wait (2)
Browser("name:=Sign In").Page("title:=Sign In").WebEdit("type:=password").SetSecure ".........."
wait (2)
Browser("name:=Sign In").Page("title:=Sign In").WebButton("type:=submit").Click
wait (10)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").Link("html id:=NewMessage").Click
wait (10)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").WebEdit("name:=WebEdit","type:=textarea","html id:=AutoCompleteTo$InputBox").set "vimalsingh2k@gmail.com"
'it doesnt accept email address
wait(10)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").WebEdit("name:=fSubject").Set "Hi"
wait(10)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").WebElement("html tag:=BODY").Set "Good Morning ..."
'unable to write text here
wait(10)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").Link("text:=Send").Click
wait (5)
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").Link("text:=sign out").click



RE: unable to send email - descriptive programming - satan - 12-22-2009

try using only html id for text area :
Code:
Browser("name:=Windows Live Hotmail").Page("title:=Windows Live Hotmail").WebEdit("html id:=.*InputBox.*").set "vimalsingh2k@gmail.com"



RE: unable to send email - descriptive programming - upadhyay40 - 12-22-2009

Hi vimal,

If that is the dynamic object then better you can use descriptive programming to get unique field, hope this will help you to solve your problem

Thanks
Mahesh


RE: unable to send email - descriptive programming - vimal singh - 12-23-2009

HI Mahesh,

Thanks for your immediate reply.. but it didnt work.. I did tried with additional property as well. One more thing how to write text in body. I am unable to do so as well


RE: unable to send email - descriptive programming - ajaykumar.g - 10-21-2011

hi
'vimal singh'
try with this one it going to work

Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = True
IE.Navigate "www.hotmail.com"
wait (2)

browser("creationtime:=.*").page("title:=.*").Link("name:=Gmail").Click

browser("creationtime:=.*").page("title:=.*").webEdit("name:=Email").Set "uid"

browser("creationtime:=.*").page("title:=.*").webEdit("name:=passwd").Set "pwd"

browser("creationtime:=.*").page("title:=.*").WebButton("name:=Sign in").Click

browser("creationtime:=.*").page("title:=.*").Link("name:=Compose Mail").Click

browser("creationtime:=.*").page("title:=.*").webEdit("name:=to").set "sample@gmail.com"

browser("creationtime:=.*").page("title:=.*").webEdit("name:=subject").Set "sample mail"

browser("creationtime:=.*").page("title:=.*").WebEdit("name:=body").Set "hi dear how are u ?"

browser("creationtime:=.*").page("title:=.*").WebButton("text:=Send").Click