Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Ordinal Identifiers(Index,Value) using VB script
#1
Not Solved
Hi All,

Please help me with this problem.
I have so many check boxes inside a webpage. And the properties of the checkbox is entirely different from the check boxes available in other webpages in the same portal.
Let me show the code I have written for checkbox.

Code:
Function SetWebCB(setting_name,setting_value)
Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").SetTOProperty "html id",setting_name
If Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").WebCheckBox("WebCheckBox").Exist Then

          If Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").WebCheckBox("WebCheckBox").GetROProperty("disabled") = 0 Then

                         checked = Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").WebCheckBox("WebCheckBox").GetROProperty("checked")

                            If  setting_value = "ON" Then

                                    If checked = 0 Then
                                            Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").WebCheckBox("WebCheckBox").Set setting_value
                                            SetWebCB = 1
                                    Else
                                            SetWebCB = 0
                                            Call write_result(1,  "Object "&setting_name&" is already checked","Comments")
                                    End If

                            ElseIf setting_value = "OFF" Then

                                    If checked=1 Then
                                            Browser("Browser").Page("Page").WebCheckBox("WebCheckBox").WebCheckBox("WebCheckBox").Set setting_value
                                            SetWebCB = 1
                                    Else
                                            SetWebCB = 0
                                            Call write_result(1,  "Object "&setting_name&" is already unchecked","Comments")
                                    End If

                            Else
                                          SetWebCB = 0
                                         Call write_result(1,  "The Parameter should be either ON/OFF","Comments")
                              
                            End if

             Else
                    SetWebCB = 0
                    Call write_result(1,  "Object "&setting_name&" is disabled","Comments")
            End If
    
Else
       SetWebCB = 0
     Call write_result(1, "Object "&setting_name&" does not exist","Comments")
End If
    
End Function

Here I am using html id as the input parameter which is given from an excel. But now what I am facing is the check boxes in the new window does'nt have html id at all. so I have to depend on ordinal identifier.

So can anyone of you can help me out here on how to use ordinal identifer?? Please help!![/align]
Reply


Messages In This Thread
How to use Ordinal Identifiers(Index,Value) using VB script - by qtplearner88 - 03-06-2012, 06:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to click on the WebButton with specified Index srach84 2 4,300 03-31-2015, 04:36 AM
Last Post: srach84
  QTP is not identifying table with column names property but its identifing with index Anuradha B 1 3,003 02-12-2015, 04:00 PM
Last Post: Kirill
  Can we set ordinal identifier at runtime qtplearner88 1 3,686 07-31-2013, 12:33 AM
Last Post: Ankur
  QTP recognizing every JavaEdit as "VTextField" having different index values. K Gaurav Varshney 1 2,402 10-29-2012, 11:51 AM
Last Post: krr
  How to increment the Index number of table. branjitk 0 2,269 07-06-2012, 03:04 PM
Last Post: branjitk

Forum Jump:


Users browsing this thread: 3 Guest(s)