# Este robô possui como pré-requisito o login no sei, a seleção da unidade correta e a criação do processo ou seleção de algum processo antes de ser iniciado. WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... 20708cbfce\'']['Image \'Incluir Documento\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''Memorando''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False # A ação seguinte pressupõe que o ícone +, que amplia a lista, já estará selecionado por conta das ações anteriores do fluxo. Caso não seja esse o seu caso, aumente/diminua a quantidade de tabs para selecionar o memorando. MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab: 2}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: sei Text: $'''Gerar Documento''') WebAutomation.Click.Click BrowserInstance: sei Control: appmask['Web Page \'h ... 3f088d29b1\'']['Label 3'] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT 1 IF responsavel_analise = $'''Breno Miguel''' THEN Clipboard.SetText Text: $'''Análise de prescrições - IA1''' ELSE IF responsavel_analise = $'''Joseana Rolim''' THEN Clipboard.SetText Text: $'''Análise de prescrições - IA2''' ELSE IF responsavel_analise = $'''Júlia Vitória''' THEN Clipboard.SetText Text: $'''Análise de prescrições - IA3''' END WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Control}{V}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Down}{Return}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: True WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Tab: 2}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False # Insere a descrição. Clipboard.SetText Text: assunto_memo WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Control}{V}{Tab}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False # Clica em restrito e insere a hipótese legal. WAIT 2 WebAutomation.ExecuteJavascript BrowserInstance: sei Javascript: $'''function ExecuteScript() { try { // Localiza o iframe na página principal var iframe = document.querySelector(\'iframe[id=\"ifrVisualizacao\"]\'); // Verifica se o iframe foi encontrado if (iframe) { // Acessa o conteúdo do iframe var iframeDocument = iframe.contentWindow.document; // Seleciona o botão de rádio dentro do iframe var radioButton = iframeDocument.querySelector(\'input[id=\"optRestrito\"][value=\"1\"]\'); if (radioButton) { // Marca o botão como selecionado radioButton.checked = true; // Dispara o evento \'click\' para simular uma interação do usuário radioButton.click(); // Cria e dispara o evento \'change\' para carregar o menu com opções de restrito var changeEvent = new Event(\'change\', { bubbles: true }); radioButton.dispatchEvent(changeEvent); return \"Botão \'Restrito\' selecionado com sucesso dentro do iframe.\"; } else { return \"Botão de rádio \'Restrito\' não encontrado dentro do iframe.\"; } } else { return \"iframe não encontrado na página.\"; } } catch (error) { return \"Erro ao executar o script: \" + error.message; } }''' Result=> Result WAIT 5 WebAutomation.ExecuteJavascript BrowserInstance: sei Javascript: $'''function ExecuteScript() { try { // Localiza o iframe na página principal var iframe = document.querySelector(\'iframe[id=\"ifrVisualizacao\"]\'); // Verifica se o iframe foi encontrado if (iframe) { // Acessa o conteúdo do iframe var iframeDocument = iframe.contentWindow.document; // Seleciona o elemento para o \'value\' desejado selectElement.value = \"1\"; // Dispara o evento \'change\' para ativar qualquer função associada ao onChange do não encontrado dentro do iframe.\"; } } else { return \"iframe não encontrado na página.\"; } } catch (error) { return \"Erro ao executar o script: \" + error.message; } }''' Result=> Result WAIT 1 # Salva o novo documento. MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei TextToSend: $'''{Alt}(S)''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT 5 WebAutomation.LaunchEdge.AttachToTheForegroundEdge AttachTimeout: 5 TargetDesktop: $'''{\"DisplayName\":\"Computador local\",\"Route\":{\"ServerType\":\"Local\",\"ServerAddress\":\"\"},\"DesktopType\":\"local\"}''' BrowserInstance=> sei_memorando DISABLE WebAutomation.LaunchChrome.AttachToForegroundChrome AttachTimeout: 5 TargetDesktop: $'''{\"DisplayName\":\"Computador local\",\"Route\":{\"ServerType\":\"Local\",\"ServerAddress\":\"\"},\"DesktopType\":\"local\"}''' BrowserInstance=> sei_memorando WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: sei_memorando Text: $'''Assunto: Resultado de Análise das prescrições''') UIAutomation.SetWindowState.SetStateByInstanceOrHandle WindowInstance: sei_memorando State: UIAutomation.WindowState.Maximized MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Tab: 4}{Control}({Right}){Right} ''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False SET nome_destinatario TO $'''Viviane Lopes Rosendo Neves''' Clipboard.SetText Text: nome_destinatario MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Control}({Shift}({Right})){Control}({Shift}({Right})){Control}({Shift}({Right})){Back}{Back}{Space}{Ctrl}{V}''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Down}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False SET cargo_destinatario TO $'''Coordenadora da Central de Abastecimento Farmacêutico''' Clipboard.SetText Text: cargo_destinatario MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Control}({Shift}({Left})){Control}({Shift}({Left})){Control}({Shift}({Left})){Ctrl}{V}''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Return: 2}{Control}{B}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''C/c: {Control}{B}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False Clipboard.SetText Text: unidade_analise MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Control}{V}''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Tab:2} ''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False Clipboard.SetText Text: unidade_analise WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Down}{Down} {LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){Right}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Right}{Control}({Shift}({Left})){Control}{V}''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False Clipboard.SetText Text: numero_trimestral WAIT 1 MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){Control}({Shift}({Right})){Control}{V}''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False WAIT 1 Clipboard.SetText Text: ano MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){LControlKey}({Right}){Control}({Shift}({Right})){Control}{V}''' DelayBetweenKeystrokes: 200 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: sei_memorando TextToSend: $'''{Control}({Alt}({S}))''' DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: False # [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\": \"7a02f8a8-831c-41fe-8f84-02a66c87f883\",\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": false,\r\n \"Name\": \"Src\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"controlador.php?acao=arvore_visualizar&acao_origem=procedimento_visualizar&id_procedimento=5087&infra_sistema=100000100&infra_unidade_atual=110001112&infra_hash=65193da4df2675ee27f58da089f76b579402bfccacb64e1251de41746bccb8a3\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": 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 \"IsDisabledAttribute\": false,\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 \"IsDisabledAttribute\": 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