QTP Forums

Full Version: Problem with Capturing objects(DropDown,Table) in SAP application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

This is first time I am automating SAP application, I Installed SAP Add-in for automating the SAP application.
SAP application details are as follows:
Portal : NetViewer Portal
Developed Languages : ABAP and Java

My problem:

1. Capturing DropDown:
I tried to capture dropdown object with Object repository but it shows as 2 WebEdit(TextBoxes). one for to set the value and one for selecting the drop down. I tried to set the value for the first WebEdit but it shows as Object is disabled.

2. Select values in the table:
I have a table with 3 columns where first column to select the row, secound describes about the row value and third column shows the value applicable for the pirticular user.
Problem is I am not able to select the first column I tried in the following way:
a) Select the child objects of the table and get the RunTime properties.
b) First column values shows as class = WebElement and text = "Selection Area".
c) so I created a Description object by using class = WebElement and text = "Selection Area"
d)Tried to click on the selected webelement.
e)Here from the script it displays as Web Element is clicked but in the application it is not clicking on the web element.

3. Inserting the value to the text box. Probelm is while Inserting the value to the text box it is displaying as Object is disabled(This problem exist only for one text box in the application. I have used the following code for enabling the text box and inserting the value as follows:

Browser("V").Page("V").SAPFrame("V").WebEdit("t").Object.disabled = False
Browser("Vedlikehold tidsdata -").Page("Vedlikehold tidsdata").SAPFrame("Vedlikehold tidsdata").WebEdit("txtLeaveType").Click
Browser("V").Page("V").SAPFrame("V").WebEdit("t").Set strLeaveType

But still it is not working.

Please help me on above 3 problems.
HI ALL ,

Could some one help me on this this Please, I am waiting for the reply...
Hi SaranKumar,
Please find below code for Click_webElement in Portal ,I used same function for my SAP portal project...............

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
Reference URL's