joseilton
(Joseilton Correia)
8 December 2020 14:25
1
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?
rasjani
(not available)
10 December 2020 09:20
2
Only location in sapguilibrary where “doubleClickItem” is called is here:
""" self.take_screenshots = False def doubleclick_element(self, element_id, item_id, column_id): """Performs a double-click on a given element. Used only for shell objects. """ # Performing the correct method on an element, depending on the type of element element_type = self.get_element_type(element_id) if element_type == "GuiShell": self.session.findById(element_id).doubleClickItem(item_id, column_id) else: self.take_screenshot() message = "You cannot use 'doubleclick element' on element type '%s', maybe use 'click element' instead?" % element_type raise Warning(message) time.sleep(self.explicit_wait) def element_should_be_present(self, element_id, message=None): """Checks whether an element is present on the screen. """ try:
if that line throws AttributeError, the chances are that findById does not return valid element or that element is not double-clickable ?