Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Capturing objects(DropDown,Table) in SAP application
#3
Not Solved
Hi SaranKumar,
Please find below code for Click_webElement in Portal ,I used same function for my SAP portal project...............

Code:
Public Function fn_Portal_ClickWebElement_Page(strPageTitle,strWebElementHtmlId_InnerText)
'*Variable Declarations
Dim objBrowser,objPage,objAllBrowser,objPortal,objWebElement
'*Browser Object
    Set objBrowser = Description.Create
    objBrowser("micclass").Value = "Browser"
    '*Get all browsers object
    Set objAllBrowser = Desktop.ChildObjects(objBrowser)
'*Page Object
    Set objPage = Description.Create
    objPage("micclass").Value = "Page"
    objPage("title").Value = strPageTitle
'*Portal Object
    Set objPortal = Description.Create
    objPortal("micclass").Value = "SAPPortal"
'*Web Element Object
    Set objWebElement = Description.Create
    objWebElement("micclass").Value = "WebElement"
    objWebElement("html id").Value = strWebElementHtmlId_InnerText

'*Look for the web element and click if it exists
If Browser("creationtime:=" & objAllBrowser.Count - 1).Page(objPage).Exist(0) Then
    If Browser("creationtime:=" & objAllBrowser.Count - 1).Page(objPage).WebElement(objWebElement).Exist(0) Then
       Browser("creationtime:=" & objAllBrowser.Count - 1).Page(objPage).WebElement(objWebElement).click
        fn_Portal_ClickWebElement_Page=true
    Else
             '*Web Element Object
            Set objWebElement = Description.Create
            objWebElement("micclass").Value = "WebElement"
            objWebElement("innertext").Value = strWebElementHtmlId_InnerText
            If Browser("creationtime:=" & objAllBrowser.Count - 1).Page(objPage).WebElement(objWebElement).Exist(0) Then
                Browser("creationtime:=" & objAllBrowser.Count - 1).Page(objPage).WebElement(objWebElement).click
                fn_Portal_ClickWebElement_Page=true
            Else
                fn_Portal_ClickWebElement_Page=false
            End if
    End if
ElseIf Browser("creationtime:=" & objAllBrowser.Count - 1).SAPPortal(objPortal).Exist(0) Then  
    If Browser("creationtime:=" & objAllBrowser.Count - 1).SAPPortal(objPortal).WebElement(objWebElement).Exist(0) Then
       Browser("creationtime:=" & objAllBrowser.Count - 1).SAPPortal(objPortal).WebElement(objWebElement).click
        fn_Portal_ClickWebElement_Page=true
    Else
             '*Web Element Object
            Set objWebElement = Description.Create
            objWebElement("micclass").Value = "WebElement"
            objWebElement("innertext").Value = strWebElementHtmlId_InnerText
            If Browser("creationtime:=" & objAllBrowser.Count - 1).SAPPortal(objPortal).WebElement(objWebElement).Exist(0) Then
                Browser("creationtime:=" & objAllBrowser.Count - 1).SAPPortal(objPortal).WebElement(objWebElement).click
                fn_Portal_ClickWebElement_Page=true
            Else
                fn_Portal_ClickWebElement_Page=false
            End if
    End if
Else
    fn_Portal_ClickWebElement_Page=false
End if

'*Releasing variables
    Set objBrowser=Nothing
    Set objPage=Nothing
    Set objAllBrowser=Nothing
    Set objPortal=Nothing
    Set objWebElement=Nothing

End Function
Reply


Messages In This Thread
RE: Problem with Capturing objects(DropDown,Table) in SAP application - by Jyobtech - 09-07-2010, 03:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Facing a problem while identifying Angular JS objects in a web page vangasantosh 0 1,222 12-20-2017, 01:26 PM
Last Post: vangasantosh
  UFT doesn't recognize SAP objects when it's openned by portal DevRenanGaspar 0 2,495 09-28-2017, 07:41 PM
Last Post: DevRenanGaspar
  capturing message on web page when caps lock is on helan 0 2,378 04-29-2015, 05:25 AM
Last Post: helan
  UFT 12 unable to recognize the objects of a java based application (jre - 1.7.0_65) Sushant Dasgupta 2 9,166 09-17-2014, 03:47 PM
Last Post: Sushant Dasgupta
Cool ntdll.dll crash problem with UFT 11.5 Application in Windows Server 08 gangadhar 1 4,808 06-13-2014, 04:43 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)