How to do Doubleclick Element on SAP GUIShell using Robot Framework? - robotframework

I am trying to automate my work in SAP using the Robot Framework with the SapGuiLibrary, but at the moment I’m having difficulties executing the Doubleclick Element command on a shell object.
After inspecting the object with Script Tracker I found the lines below:
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").setCurrentCell 2,"STRAS"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectedRows = "2"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").doubleClickCurrentCell
The command asks for 3 parameters:
Doubleclick Element element_id item_id column_id
So I put like this:
Doubleclick Element wnd[0]/usr/cntlGRID1/shellcont/shell 2 STRAS
But it dind't work as you can see below:
AttributeError: <unknown>.doubleClickItem
So what am I doing wrong?

I think it's a current limitation of SapGuiLibrary.
The keyword DoubleClick Element is only for double clicking an item in a Tree control of type "List" or "Column" (object GuiTree).
In your case, you want to double-click a cell in a Grid control (object GuiGridView), but SapGuiLibrary doesn't propose a keyword for that.
Either you file a bug at https://github.com/frankvanderkuur/robotframework-sapguilibrary/issues, or you do the correction yourself.
NB: if you're a developer, you may see all the limitations by comparing the SapGuiLibrary code and all possible SAP GUI Scripting objects and methods (use this direct link if the search hangs).

Related

(Robot Framework IDE) RIDE->Search Tests Window-> Search tab what is "ADD all to Selected" used for

As the title says, in RIDE interface for Robot Framework, on the Search Tests Window, i have two Tabs:
1-Search 2- Add All to Selected
For first Tab, i wonder if i can insert a list of Test cases on search box and if the second TAB
will tick them on the interface.
I couldn't use it in this way but seems to function like that.
Any idea?
Edit:
So here i have added two complete test names separated with comma followed by space:
but as you see the Search Engine finds only the last test name. I can search by what i have added as TestID inside Documentation of each test,and add something like :
TC-69, TC67 but search engine finds as before only the last test.
You don't mention what version of RIDE you are using. In the past there was a bug on that search feature.
Today I have verified that Search function is working as expected on RIDE version 2.0b2, in Windows 10, Python 3.9 and wxPython 4.1.1.
I used a list in the Search box and then Add All to Selected. I use a large test name and a partial test name:
9__Checks if all the firewall rules related to the Network Discovery group are disabled, 2_
Here is a partial capture of the dialog (not the best colors combination ;) :
EDIT: Please edit the search text to not include the word Acces or Accès, so it is only Contextuel_REFSITE.
Another problem (could be a bug in RIDE) is the documentation having latin characters, and the search function become broken.
The tab Tag Search, will only search by tags, and then you have the option to add to Included or to Excluded tests.
Note: It is very important to confirm the version of RIDE you are using (Tools->View RIDE Log).

Full list of methods for COM objects

I would like to know which functions I can use with RDCOMClient objects.
For example, to create an email we can use
OutApp <- COMCreate("Outlook.Application")
# create an email
outMail = OutApp$CreateItem(0)
Along with outMail[["subject"]], outMail[["HTMLbody"]] or outMail[["Attachments"]]$Add(filepath)
But how can I get a comprehensive list?
The RDCOMClient doc is out-of date and the functions listed such as getFuncs() and getElements() are not available in the package anymore. Using names() to try and find out what was under the hood gave me no result, and
install.packages("remotes")
remotes::install_github("omegahat/SWinTypeLibs")
gives an error as well. Any idea on how to check Outlook for objects?
If you have Outlook, Excel or Word installed then you can do the following ...
Press F11 to get to a Visual Basic Application (VBA) Integrated Development Environment (IDE).
On the menu bar go to Tools->References to prompt the References dialog box.
On the References dialog box, in the Available References checkbox list, page down until you find Microsoft Outlook Library (or similar), once found then check the checkbox and then press OK to confirm selection and dismiss dialog. This adds a reference to the Outlook type library to the current project.
With the Outlook type library referenced (see step (3)) one can now press F2 to show the Object Browser dialog box.
In the Object Browser dialog box, select the top left dropdown list which will probably say <All Libraries> . Change the dropdown so it says Outlook, this will scope the object browser to just the Outlook type library.
You can now browse all the objects in the Outlook type library. Select a class in the Classes pane on the left hand side and the class's methods will appear in the right hand side.
Enjoy!
I am not sure of a way to do this in R, but you should be able to do it in powershell.
I am still learning powershell, but this at the very least gets all the properties and methods of an object:
$ol = New-Object -ComObject Outlook.Application
$new_item = $ol.CreateItem(0)
$new_item | Get-Member
TypeName: System.__ComObject#{...}
Name MemberType Definition
---- ---------- --------
HTMLBody Property string HTMLBody () {get} {set}
Subject Property string Subject () {get} {set}
Attachments Property Attachments Attachments() {get}
There are a lot more than this but I'm actually transcribing from my other computer which has Outlook installed. The Get-Member works on more than just the application object so you can also see the members and properties accessible to the Outlook object itself or other COMS.
It also appears that the VBA resources may be helpful:
https://learn.microsoft.com/en-us/office/vba/api/outlook.application.createitem
Name
Value
Description
olAppointmentItem
1
An AppointmentItem object.
olContactItem
2
A ContactItem object.
olDistributionListItem
7
A DistListItem object.
olJournalItem
4
A JournalItem object.
....
...
...
And most importantly:
https://learn.microsoft.com/en-us/office/vba/api/outlook.mailitem
PROPERTIES
---------
Actions
AlternateRecipientAllowed
Application
Attachments
AutoForwarded
AutoResolvedWinner
BCC
BillingInformation
Body
BodyFormat
Categories
CC
...
This can somewhat easily be done for Outlook, because every outlook object has a class property.
If you have a given object of COMIDispatch class in R, and it is a reference to an Outlook object, you can use the function class() to retrieve its class and then check the OlObjectClass enumeration for what properties and methods that class has.
A short step by step example:
> # initialise the app
> Outlook_App <- RDCOMClient::COMCreate("Outlook.Application")
In order to find out what we can do with that object, we need to look up the reference. For that, we need its class.
> Outlook_App$class()
[1] 0
So we look up 0 in the OlObjectClass enumeration and find out it's an Application object. Its properties and methods are listed in the referenced link in the OlObjectClass enumeration: Application.
Here, we have access to the methods and properties. For the events, we would need the now defunct packages RDCOMEvents and/or RDCOMServer.
But we can try the method getNameSpace("MAPI") to access some other functionality. We know that we have to use the "MAPI" parameter from the method description linked above.
> Outlook_Namespace <- Outlook_App$getNameSpace("MAPI")
Now, the Namepace object has another class, for which we can look up the object definition and so on and so forth.
Unfortunately this does not work for Excel objects, since they do not have a class property, if anyone knows a solution please contact me.

How do I send data to this checkbox using python with selenium web-driver

I am trying to automate this webpage and send some data to a checkbox with a dynamic #id.
I have used sample codes I found online but the test keeps failing due to not finding the element.
XPath for the webpage text box: //*[#id="undefined-Filter-undefined-24212"]
element:
In the snipped provided, the 24212 int is dymanic.
You can try something like and instead of name use x_path:
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
For reference : https://selenium-python.readthedocs.io/getting-started.html

Error while build on Simple List form in AX7

I faced one issue while building Simple List form in AX7. I added all missing controls on form still its giving below error on build.
Pattern 'Simple List' requires a sub-pattern specified on control 'AXForm/Form name//Design/Controls/CustomFilterGroup'.
If you have an error informing you, that you have missing sub-pattern you should search for "unspecified" in the Form Designer. This search will show you all nodes where you have a missing sub-pattern.
For me this seems the easiest way to find all places where there is still work to be done in the Form. By work to be done, I mean to apply a fitting sub-pattern.
Here is an example:
After analyzing the new changes in AX7, I found that we also need to apply sub-patterns on Custom Filters in Simple List form pattern otherwise form will not build successfully. So to apply sub patterns on custom filter group , right click on group, select apply pattern and then click on Custom and Quick Filters. This will apply sub patterns to custom filters and you will be able to successful build the form.
you can use "form statistics". its show, how many object covered by patterns and there is left any unspecified object.
to do this: open form, right-click the form in the designer, and then select Addins > Form statistics.
its looks like: http://msdynamics.blob.core.windows.net/media/2015/09/formStatistics.png
source: https://ax.help.dynamics.com/en/wiki/form-styles-and-patterns/

c# asp.net report and sub report in report viewer (or reportviewer)

I did all the steps from this waltrought:
http://blogs.msdn.com/b/sqlforum/archive/2011/01/03/walkthrough-add-a-subreport-in-local-report-in-reportviewer.aspx
and when i run it i get the first father report and instead the sub
report i get:
Data retrieval failed for the subreport, 'Subreport5',
located at: C:...
i attach a print screen file
i am using VS2010 framework 3.5.
Can you run the subreport by itself, given the right parameters? If you can't, your problem is that.
If you can run it successfully by itself, double-check that you are passing the parameters correctly to your subreport. Make sure the parameter types match and that you are passing all of them.
Another problem might be that -- if I recall correctly -- when you have a subreport in a local report, you need to provide the data for the subreport programmatically, just as you do with the parent report. There's an event that's raised - SubreportProcessingEvent -- when the subreport is being processed. You write a handler for that event and supply data in the handler. Here's some more information about it: LocalReport.SubReportProcessingEvent. There's a good example on that page.

Resources