# Este robô possui como pré-requisito o login no sei, a seleção da unidade correta e o processo criado e aberto. # Abre planilha do excel na qual constam os documentos que devem ser incluidos no SEI. Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: caminho_excel Visible: True ReadOnly: False Instance=> excel # Lê planilha do excel e identifica sua extensão. Excel.GetFirstFreeRowOnColumn Instance: excel Column: $'''A''' FirstFreeRowOnColumn=> linha_livre # Define variável correspondente ao número da linha do excel que será iterada. SET linha_excel TO 2 LOOP WHILE (linha_excel) <= (linha_livre - 1) # Le valores do excel e salva em variáveis. Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''a''' StartRow: linha_excel ReadAsText: False CellValue=> tipo_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''B''' StartRow: linha_excel ReadAsText: False CellValue=> data_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''C''' StartRow: linha_excel ReadAsText: False CellValue=> numero_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''D''' StartRow: linha_excel ReadAsText: False CellValue=> nome_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''E''' StartRow: linha_excel ReadAsText: False CellValue=> formato_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''F''' StartRow: linha_excel ReadAsText: False CellValue=> tipo_conferencia Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''G''' StartRow: linha_excel ReadAsText: False CellValue=> acesso_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''H''' StartRow: linha_excel ReadAsText: False CellValue=> hipotese_restricao_documento Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''I''' StartRow: linha_excel ReadAsText: False CellValue=> caminho_pasta Excel.ReadFromExcel.ReadCell Instance: excel StartColumn: $'''J''' StartRow: linha_excel ReadAsText: False CellValue=> nome_arquivo # Clica para incluir novo documento. WAIT 2 WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... 0#ID-12562\'']['Image \'Incluir Documento\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 # Aguarda o carregamento da página. WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: sei Text: $'''Escolha o Tipo do Documento:''') # Expande opções de tipos de documentos. WAIT 2 WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... -883938343\'']['Image \'Exibir todos os tipos\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 # Aguarda carregamento de tipos de documentos. WAIT 2 # Seleciona documento externo. MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''Externo{Down}{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False # Aguarda o carregamento da página. WAIT 2 # Seleciona tipo de doumento da planilha MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab}{Tab}{Tab}{Tab}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Alt}({Down})''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''%tipo_documento%{Return}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False # Aguarda o carregamento da página. WAIT 3 # Preenche infomrações do formulário para criação de documento. MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}%data_documento%''' DelayBetweenKeystrokes: 50 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab}{Tab}%numero_documento%''' DelayBetweenKeystrokes: 50 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab}%nome_documento%''' DelayBetweenKeystrokes: 50 SendTextAsHardwareKeys: False WAIT 2 IF Contains(formato_documento, $'''Nato-digital''', True) THEN WebAutomation.SelectRadioButton.SelectRadioButton BrowserInstance: sei Control: appmask['Web Page \'h ... 1a7c384480\'']['Label 2'] WaitForPageToLoadTimeout: 60 ELSE IF Contains(formato_documento, $'''Digitalizado nesta Unidade''', True) THEN WebAutomation.SelectRadioButton.SelectRadioButton BrowserInstance: sei Control: appmask['Web Page \'h ... f#ID-12917\'']['Label 3'] WaitForPageToLoadTimeout: 60 WAIT 3 WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... 3#ID-12912\'']['Select \'selTipoConferencia\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 IF Contains(tipo_conferencia, $'''Cópia Simples''', True) THEN MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Down}{Down}{Down}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False ELSE IF Contains(tipo_conferencia, $'''Cópia autenticada administrativamente''', True) THEN MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Down}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False ELSE IF Contains(tipo_conferencia, $'''Cópia autenticada por cartório''', True) THEN MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Down}{Down}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False ELSE IF Contains(tipo_conferencia, $'''Documento original''', True) THEN MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Down}{Down}{Down}{Down}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False END END WAIT 2 IF Contains(acesso_documento, $'''público''', False) THEN WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... -883938433\'']['Div \'Público\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 ELSE # Clica em restrito e insere a hipótese legal. WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... -883938433\'']['Div \'Restrito\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT 1 WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... -883938425\'']['Select \'selHipoteseLegal\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''%hipotese_restricao_documento%{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False END WAIT 2 WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... -883938445\'']['Label \'Anexar Arquivo...\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Return}%caminho_pasta%{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''%nome_arquivo%{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab}{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False WAIT 2 IF (OCR.IfTextOnScreen.TextOnScreenExistsWithWindowsOcr TextToFind: $'''Deseja continuar?''' IsRegex: False WindowsOcrLanguage: OCR.WindowsOcrLanguage.Portuguese SearchForTextOn: OCR.SearchTarget.EntireScreen ImageWidthMultiplier: 1 ImageHeightMultiplier: 1 TextLocationX=> LocationOfTextFoundX TextLocationY=> LocationOfTextFoundY) THEN MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False END WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{LShiftKey}({Tab}){Return}{Return}''' DelayBetweenKeystrokes: 400 SendTextAsHardwareKeys: False Clipboard.GetText Text=> ndoc Variables.IncreaseVariable Value: linha_excel IncrementValue: 1 END # [ControlRepository][PowerAutomateDesktop] { "ControlRepositorySymbols": [ { "IgnoreImagesOnSerialization": false, "Repository": "{\r\n \"Screens\": [\r\n {\r\n \"Controls\": [\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Image\",\r\n \"InstanceId\": \"eb8c1d90-a80b-472f-8ced-472343b0f571\",\r\n \"Name\": \"Image 'Incluir Documento'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": null,\r\n \"Elements\": [\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Body 'AAA BBB CCC Versão distribuída pelo Ministério da ... otstrap(\\\"procedimento_trabalhar\\\") Processo'\",\r\n \"Tag\": \"body\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"vh-100 vw-100 d-flex flex-column m-0 border-0\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"divInfraAreaGlobal\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Div 'AAA BBB CCC Versão distribuída pelo Ministério da ... otstrap(\\\"procedimento_trabalhar\\\") Processo'\",\r\n \"Tag\": \"div\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"w-100 flex-grow-1 d-flex flex-row divInfraAreaTela\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"divInfraAreaTela\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Div 'Acompanhamento Especial Administração Tramita ... otstrap(\\\"procedimento_trabalhar\\\") Processo'\",\r\n \"Tag\": \"div\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"flex-grow-1 px-3\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"divInfraAreaTelaD\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Div 'Processo'\",\r\n \"Tag\": \"div\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"w-100 d-flex flex-grow-1 flex-lg-row\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"divConteudo\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Div 'divConteudo'\",\r\n \"Tag\": \"div\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"flex-grow-1 d-none d-lg-block h-100 divLinha\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"divIframeVisualizacao\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"Div 'divIframeVisualizacao'\",\r\n \"Tag\": \"div\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \" w-100\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"ifrVisualizacao\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Name\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"ifrVisualizacao\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Src\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"controlador.php?acao=arvore_visualizar&acao_origem=procedimento_visualizar&id_procedimento=12562&infra_sistema=100000100&infra_unidade_atual=110001112&infra_hash=c98974209584522e3b215720641e0d713f89dc9c875ccc22ac60fcae63f1d668\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"SrcDoc\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": false,\r\n \"Name\": \"Inline frame 'ifrVisualizacao'\",\r\n \"Tag\": \"iframe\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Title\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": null\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": true,\r\n \"Name\": \"HTML document 'SEI - Visualizar Árvore