Fireevent(onmousedown) and (onclick) not worknig for webelement

395 views
Skip to first unread message

surabhi

unread,
Jul 24, 2013, 3:58:26 PM7/24/13
to mercu...@googlegroups.com
All,

I am trying to automate the suggestion list for a webedit box. I basically want to scroll down and select a value. I have the below code, however, it is not working.Can anyone please help.

BrowserPage.WebEdit("type:=text", "name:=string_A11.*", "html tag:=INPUT").Set objDriverSheet.Cells(r, d.Item(Trim("Insurer Short name_Value"))) 
Set ListElmt = Description.Create()
ListElmt("micclass").value = "WebElement"
ListElmt("class").value = "search-item"
ListElmt("html tag").value = "DIV"

BrowserPage.WebEdit("type:=text", "name:=string_A11.*", "html tag:=INPUT").FireEvent "onkeyUP"
wait 10
BrowserPage.WebElement("class:=search-item", "micclass:=WebElement", "index:=11").FireEvent "onmousedown"
BrowserPage.WebElement("class:=search-item", "micclass:=WebElement", "index:=11").FireEvent "onclick"


I have also tried with x,Y coordinates but it doesn't work

xval = Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").GetroProperty("x")
yval = Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").GetroProperty("y")
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Click xval,yval


Thanks,
surabhi


ChandraKanth

unread,
Jul 25, 2013, 5:56:46 AM7/25/13
to mercu...@googlegroups.com
Check this out....This could be a temparloy solution...
 
<<>> Code<<>>
 
If pageObj.WebEdit(Trim(strPageObjectsArray(intIndex))).WaitProperty("visible",True,1000) Then
       pageObj.WebEdit(Trim(strPageObjectsArray(intIndex))).Set trim(strPageDataArray(intIndex))
              pageObj.WebEdit(Trim(strPageObjectsArray(intIndex))).MiddleClick
              Set objWShell = CreateObject("WScript.Shell")
              objWShell.SendKeys "{HOME}"
              objWShell.SendKeys " "
              Wait 1
              objWShell.SendKeys "{BACKSPACE}"
              objWShell.SendKeys "{ENTER}"
       Call VerifyActualExpected (UCase(Trim(pageObj.WebEdit(Trim(strPageObjectsArray(intIndex))).GetROProperty("value"))),UCase(Trim(strPageDataArray(intIndex))),"Verify PageFill:Text Box","'"&strPageDataArray(intIndex)&"' is displayed")
      Else
       RepErr "Object:"&strPageObjectsArray(intIndex)&" does not exist"
      End If
 
<<>>Code End<<>>

prasenjit nandy

unread,
Jul 25, 2013, 6:18:59 AM7/25/13
to mercu...@googlegroups.com
Hi Surabhi,
Can you try with SendKey as below -
 
set obj=createobject("Wscript.Shell")
obj.sendkey"{DOWN}"
obj.sendkey"{DOWN}"
 
When the suggestion text displayed use the above code to select each search item.
 
Thanks
Prasenjit

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

surabhi

unread,
Jul 25, 2013, 9:15:23 AM7/25/13
to mercu...@googlegroups.com
Where is the function code for Call VerifyActualExpected? I am able to display the suggestion list, but want to select an item.

surabhi

unread,
Jul 26, 2013, 10:31:53 AM7/26/13
to mercu...@googlegroups.com
okay..the above code worked for me! Thank you very much!
Reply all
Reply to author
Forward
0 new messages