QTP not recognizing SAP CRM SAPNavigationbar object items

I am trying to select an item on the SAP Navigation Bar (Move In Out; Move In) in the SAP CRM screeen.

When doing a recording, the code is genearted.

Code:

Browser("Interaction Center - [Identificatio").Page("Interaction Center - [Identificatio").SAPFrame("Interaction Center - [Identificatio").SAPNavigationBar("SAPNavigationBar").Select "Move In Out;Move In"

But replaying the same code, the code does work as QTP does not recognize the object.

Error:

Cannot identify the specified item of the SAPNavigationBar object. Confirm that the specified item is included in the object's item collection

Please clarify to me at the earliest.


Please refer to the document for more details.

Tags:

Parents

  • Try using the below code
    Set SAPNVBar = Browser("SAP CRM - [Account Management]").Page("SAP CRM - [Account Management]").SAPFrame("SAP CRM - [Account Management]").SAPNavigationBar("SAPNavigationBar").Object.GetElementsByTagName("a")
    SAPNVBar(index).click

    index should be the strip one needs be click.
  • Hi,

     

    I am using GetelementByTagName to get the node in th enavigation bar .. but its not working for me.

     

    Could anyone please suggest how to click on node in SAP naviagtion Bar.

     

    used String :set node1=  Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").object.getelementsByTagName("Conplaint")

    node1(5).click

  • Hi,

    When we use getelementsByTagName, the 'Tag' it is referring to is the HTML tag. Since the SAPNavigationBar is just a bunch of links, the tag will always be "a", since <a> is the HTML link tag. So your code should look like this:

     

     

    set node1=  Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").object.getelementsByTagName("a")

    node1(5).click

     

    This will work as long as you always want to click the 5th link. If the items will ever change, or will be different depending on the user, you would want something more like this:

     

    'Get all items from Nav Bar

    Set objNavBarItems = Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").Object.getElementsByTagName("a")
    Set objCorrectItem = Nothing

    'Search for entry by name
    For each objNavItem in objNavBarItems
        If objNavItem.Title = "complaint" Then
            Set objCorrectItem = objNavItem

        End If
    Next
     
    If objCorrectItem is Nothing Then
        'Item not found - print some error message

    Else
        objCorrectItem.Click

    End If

  • Hi,

    When we use getelementsByTagName, the 'Tag' it is referring to is the HTML tag. Since the SAPNavigationBar is just a bunch of links, the tag will always be "a", since <a> is the HTML link tag. So your code should look like this:

     

     

    set node1=  Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").object.getelementsByTagName("a")

    node1(5).click

     

    This will work as long as you always want to click the 5th link. If the items will ever change, or will be different depending on the user, you would want something more like this:

     

    'Get all items from Nav Bar

    Set objNavBarItems = Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").Object.getElementsByTagName("a")
    Set objCorrectItem = Nothing

    'Search for entry by name
    For each objNavItem in objNavBarItems
        If objNavItem.Title = "complaint" Then
            Set objCorrectItem = objNavItem

        End If
    Next
     
    If objCorrectItem is Nothing Then
        'Item not found - print some error message

    Else
        objCorrectItem.Click

    End If

  • Hi,

    When we use getelementsByTagName, the 'Tag' it is referring to is the HTML tag. Since the SAPNavigationBar is just a bunch of links, the tag will always be "a", since <a> is the HTML link tag. So your code should look like this:

     

     

    set node1=  Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").object.getelementsByTagName("a")

    node1(5).click

     

    This will work as long as you always want to click the 5th link. If the items will ever change, or will be different depending on the user, you would want something more like this:

     

    'Get all items from Nav Bar

    Set objNavBarItems = Browser(" ").Page("").SAPFrame("").SAPNavigationBar("SAPNavigationBar").Object.getElementsByTagName("a")
    Set objCorrectItem = Nothing

    'Search for entry by name
    For each objNavItem in objNavBarItems
        If objNavItem.Title = "complaint" Then
            Set objCorrectItem = objNavItem

        End If
    Next
     
    If objCorrectItem is Nothing Then
        'Item not found - print some error message

    Else
        objCorrectItem.Click

    End If

  • Thanks Joshua S_1 . This worked for me. But it takes a very long time to recognize SAP Navigation Bar. Is there anything we can do to make it faster?
  • Thanks Joshua S_1 . This worked for me. But it takes a very long time to recognize SAP Navigation Bar. Is there anything we can do to make it faster?
  • Thanks Joshua S_1 . This worked for me. But it takes a very long time to recognize SAP Navigation Bar. Is there anything we can do to make it faster?
Reply Children
No Data