Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem in assigning value in a script
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

Code:
Function SetSource
Set WbEdit = Description.Create()
WbEdit("micclass").Value = "Link"
WbEdit("name").Value = "C"
WbEdit("href").Value=javascript:Copy"('nessusId','0','4')"

Set AllWbEdit = Browser("micclass:=browser").Page("micclass:=Page").ChildObjects(WbEdit)
NumberOfEdits=AllWbEdit.Count
msgbox(NumberOfEdits)
For i=0 to (NumberOfEdits-1)
    if AllWbEdit(i).GetRoproperty("href")<>javascript:Copy"('sourceName','0','2')"  then
        AllWbEdit(i).Click
   End if
Next
End Function

I am getting syntax error.
when observed with object spy:The objects href property:

javascript:Copy('sourceName','0','2')

when i directly use this value its treating as comments.
Any help will be really appreciated.
Regards;
Vijay
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
whenever you assign a string value use double quotes (")
in this use it like
"jCopy"("'sourceName','0','2'")" "

Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Function SetSource
Hi,

Code:
Set WbEdit = Description.Create()
WbEdit("micclass").Value = "Link"
WbEdit("name").Value = "C"

Set AllWbEdit = Browser("micclass:=browser").Page("micclass:=Page").ChildObjects(WbEdit)
NumberOfEdits=AllWbEdit.Count
msgbox(NumberOfEdits)
For i=0 to (NumberOfEdits-1)
    if AllWbEdit(i).GetRoproperty("href")<>"javascript:Copy"("'nessusId','0','2'") " "  then
        AllWbEdit(i).Click
   End if
Next
End Function
I am getting syntax error, end of statement required.
Any help will be really appreciated
Regards;
vijay
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
very sorry, it was my mistake.
this should work-
"jCopy('sourceName','0','2')"

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Assigning object properties to a variable using dp nmakkena 1 3,958 04-18-2014, 06:46 AM
Last Post: kgovadav
  Microsoftoutlook 2003 Email from QTP Script waring box problem Uma 5 5,372 11-30-2011, 02:05 PM
Last Post: tirru

Forum Jump:


Users browsing this thread: 4 Guest(s)