WebAutomation.LaunchChrome.LaunchChromeCloseDialog Url: $'''https://cnd.pbh.gov.br/CNDOnline/''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 PiPUserDataFolderMode: WebAutomation.PiPUserDataFolderModeEnum.AutomaticProfile TargetDesktop: $'''{\"DisplayName\":\"Computador local\",\"Route\":{\"ServerType\":\"Local\",\"ServerAddress\":\"\"}}''' BrowserInstance=> site_cnd_pbh WebAutomation.ExecuteJavascript BrowserInstance: site_cnd_pbh Javascript: $'''function ExecuteScript() { const label = document.querySelector(\'label[for=\"meuForm:TIPO1\"]\'); if (label) { label.click(); console.log(\"Label clicked!\"); } else { console.log(\"Label not found.\"); } }''' Result=> Result WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: site_cnd_pbh Text: $'''CNPJ:''') FOR 12 WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: cnpjatual DelayBetweenKeystrokes: 100 SendTextAsHardwareKeys: True WebAutomation.Click.Click BrowserInstance: site_cnd_pbh Control: appmask['Web Page \'https://cnd.pbh.gov.br/CNDOnline/\'']['Image \'Pesquisar\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT (UIAutomation.WaitForWindow.ToOpenByTitleClass Title: $'''cnd.pbh.gov.br/CNDOnline/guiaCND.xhtml - Google Chrome''' Class: $'''Chrome_WidgetWin_1''' FocusWindow: True) MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({A})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({C})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False Clipboard.GetText Text=> Situacao MouseAndKeyboard.SendKeys.FocusAndSendKeysByTitleClass Title: $'''cnd.pbh.gov.br/CNDOnline/guiaCND.xhtml - Google Chrome''' Class: $'''Chrome_WidgetWin_1''' TextToSend: $'''{Control}({p})''' DelayBetweenKeystrokes: 40 SendTextAsHardwareKeys: True MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Alt}(){F4}''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeysByTitleClass Title: $'''cnd.pbh.gov.br/CNDOnline/guiaCND.xhtml - Google Chrome''' Class: $'''Chrome_WidgetWin_1''' TextToSend: $'''{Return}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: True DISABLE UIAutomation.Click.Click Element: appmask['Pane \'cnd.p ... Chrome: André Luiz\'']['Button \'Imprimir\''] ClickType: UIAutomation.ClickType.LeftClick MousePositionRelativeToElement: UIAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 WAIT (UIAutomation.WaitForWindow.ToOpenByTitleClass Title: $'''Salvar Saída de Impressão como''' Class: $'''#32770''' FocusWindow: True) MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''%empresa%_CND_PBH''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({l})%pasta%{Return}''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True # prezado usuário, por favor verifique a melhor forma de salvar o documento: tabs (pode depender da versão do Windows, ou da forma de exibição da caixa de 'Salvar como') ou clicar na interface de usuário MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 120 SendTextAsHardwareKeys: True DISABLE UIAutomation.Click.Click Element: appmask['Pane \'cnd.p ... Chrome: André Luiz\'']['Button \'Salvar\''] ClickType: UIAutomation.ClickType.LeftClick MousePositionRelativeToElement: UIAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 UIAutomation.CloseWindow.CloseByTitleClass Title: $'''cnd.pbh.gov.br/CNDOnline/guiaCND.xhtml - Google Chrome''' Class: $'''Chrome_WidgetWin_1''' IF Contains(Situacao, $'''CPF/CNPJ INEXISTENTE''', True) THEN Excel.WriteToExcel.WriteCell Instance: fornecedores Value: $'''CPF/CNPJ INEXISTENTE''' Column: $'''J''' Row: linhaatual ELSE IF Contains(Situacao, $'''CERTIFICAMOS QUE CONSTA(M) PARA O CONTRIBUINTE ACIMA IDENTIFICADO DEBITOS PARA COM A FAZENDA PUBLICA MUNICIPAL, ATE A PRESENTE DATA, CONFORME ABAIXO DISCRIMINADO(S):''', False) THEN Excel.WriteToExcel.WriteCell Instance: fornecedores Value: $'''Verificar os débitos com a fazenda pública municipal''' Column: $'''J''' Row: linhaatual ELSE IF Contains(Situacao, $'''POSITIVA COM EFEITO NEGATIVO''', False) THEN Excel.WriteToExcel.WriteCell Instance: fornecedores Value: $'''POSITIVA COM EFEITO NEGATIVO - verificar ressalvas''' Column: $'''J''' Row: linhaatual ELSE Excel.WriteToExcel.WriteCell Instance: fornecedores Value: $'''CND Válida''' Column: $'''J''' Row: linhaatual END END Clipboard.Clear _ WebAutomation.CloseWebBrowser BrowserInstance: site_cnd_pbh EXIT FUNCTION # [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\": \"37bba25a-6897-4028-ba1c-877b2ab0c4b9\",\r\n \"Name\": \"Image 'Pesquisar'\",\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 'Certidão Negativa de Débito /* '\",\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\": \"content\"\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\": \"Div '/*