Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I use html id as an unique identifier for all the components in a web page
#1
Solved: 10 Years, 9 Months ago
Hi,
I am facing a problem here. We are automating a web portal and we use key word driven framework. We have some libraries and we call the functions through an excel with the properties of components(button,checkbox,Link etc) as parameter.
So when I say properties, I am parameterizing any one of the property of combinations of two.

For Eg:
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").Exist Then

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

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

                            If  setting_value = "ON" Then

                                    If checked = 0 Then
                                            Browser("Browser").Page("Page").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").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

In this function for checkbox I am using html id . So my doubt is that can we use html id for all the components in a portal. Will QTP identifies an object only with the help of only html id.
Please help me in this
Reply


Messages In This Thread
Can I use html id as an unique identifier for all the components in a web page - by qtplearner88 - 03-16-2012, 09:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,292 10-01-2019, 10:44 AM
Last Post: shilpi952
  How to identify dynamic webtable as unique in QTP? sudheendramurthy 4 18,093 02-23-2016, 06:16 PM
Last Post: vinod123
  DP Web Browser/Page issues rstimers 1 2,311 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,049 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira
  regular expression in html sujaravi123 0 2,208 12-31-2013, 03:00 PM
Last Post: sujaravi123

Forum Jump:


Users browsing this thread: 1 Guest(s)