WebAutomation.LaunchChrome.LaunchChromeCloseDialog Url: $'''https://consulta-crf.caixa.gov.br/consultacrf/pages/consultaEmpregador.jsf''' 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_fgts MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}%cnpjatual%''' DelayBetweenKeystrokes: 25 SendTextAsHardwareKeys: True WAIT 5 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''Inserir Captcha''' Message: $'''FAVOR DIGITAR AS LETRAS E NUMEROS PRESENTES NA IMAGEM, AO FINALIZAR PRESSIONE \"Consultar\"''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False Timeout: 5 ButtonPressed=> ButtonPressed WAIT 4 LABEL 'ERRO CAPTCHA' IF (WebAutomation.IfWebPageContains.WebPageContainsText BrowserInstance: site_fgts Text: $'''Código Captcha Inválido''') THEN MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 25 SendTextAsHardwareKeys: True MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}''' DelayBetweenKeystrokes: 25 SendTextAsHardwareKeys: True Display.ShowMessageDialog.ShowMessage Title: $'''ERRO''' Message: $'''Houve um erro com a escrita do captcha tente novamente. Ao finalizar clique em CONSULTAR para retomada automatica do fluxo''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed2 IF (WebAutomation.IfWebPageContains.WebPageContainsText BrowserInstance: site_fgts Text: $'''Código Captcha Inválido''') THEN GOTO 'ERRO CAPTCHA' END END WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: site_fgts Text: $'''Resultado da consulta''') FOR 60 IF (WebAutomation.IfWebPageContains.WebPageContainsText BrowserInstance: site_fgts Text: $'''Empregador não cadastrado''') THEN WebAutomation.CloseWebBrowser BrowserInstance: site_fgts Excel.WriteToExcel.WriteCell Instance: fornecedores Value: $'''não cadastrado''' Column: $'''k''' Row: linhaatual EXIT FUNCTION END MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({A})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({C})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False Clipboard.GetText Text=> situacap_fgts Text.CropText.CropTextBetweenFlags Text: situacap_fgts FromFlag: $'''A EMPRESA abaixo identificada está''' ToFlag: $''':''' IgnoreCase: True CroppedText=> CroppedText IsFlagFound=> IsFlagFound Excel.WriteToExcel.WriteCell Instance: fornecedores Value: CroppedText Column: $'''k''' Row: linhaatual MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: site_fgts Text: $'''Visualizar''') MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainText BrowserInstance: site_fgts Text: $'''Imprimir''') MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Return}''' DelayBetweenKeystrokes: 60 SendTextAsHardwareKeys: False WAIT (UIAutomation.WaitForWindow.ToBecomeFocusedByTitleClass Title: $'''Salvar Saída de Impressão como''' Class: $'''''') MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''%empresa%_FGTS''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Control}({l})''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True WAIT 2 MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: pasta DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Return}''' DelayBetweenKeystrokes: 20 SendTextAsHardwareKeys: True DISABLE UIAutomation.Click.Click Element: appmask['Pane \'Outlook – ... Leidi (Pessoa 2)\'']['Button \'Salvar\' 2'] ClickType: UIAutomation.ClickType.LeftClick MousePositionRelativeToElement: UIAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 UIAutomation.CloseWindow.CloseByInstanceOrHandle WindowInstance: site_fgts 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\": \"Button\",\r\n \"InstanceId\": \"bee32f89-257e-4189-9579-5e0ee1bed99e\",\r\n \"Name\": \"Button 'Salvar' 2\",\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\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"#32770\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Enabled\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Name\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"Salvar como\"\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\": \"Process\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"chrome\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Visible\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": false,\r\n \"Name\": \"Window 'Salvar como'\",\r\n \"Tag\": \"window\"\r\n },\r\n {\r\n \"Attributes\": [\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"Button\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Enabled\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"1\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"IsDefault\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": false\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Name\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"Salvar\"\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\": \"Visible\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": false,\r\n \"Name\": \"Button 'Salvar'\",\r\n \"Tag\": \"button\"\r\n }\r\n ],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": false,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"button\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\0677139a-d864-4345-ba88-77e0ec1f97d9.png\"\r\n }\r\n ],\r\n \"Handle\": {\r\n \"value\": 0\r\n },\r\n \"ProcessName\": null,\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Pane\",\r\n \"InstanceId\": \"0fb5383c-0b88-47c1-936b-1e5ed9030dfe\",\r\n \"Name\": \"Pane 'Outlook – ... Leidi (Pessoa 2)'\",\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\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Class\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"Chrome_WidgetWin_1\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Enabled\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Id\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Name\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"Outlook – calendário e email pessoal gratuitos da Microsoft - Google Chrome: Leidi (Pessoa 2)\"\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": true,\r\n \"Name\": \"Ordinal\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": 0\r\n },\r\n {\r\n \"Ignore\": false,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Process\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": \"chrome\"\r\n },\r\n {\r\n \"Ignore\": true,\r\n \"IsOrdinal\": false,\r\n \"Name\": \"Visible\",\r\n \"Operation\": \"EqualTo\",\r\n \"Value\": true\r\n }\r\n ],\r\n \"CustomValue\": null,\r\n \"Ignore\": false,\r\n \"Name\": \"Pane 'Outlook – calendário e email pessoal gratuitos da Microsoft - Google Chrome: Leidi (Pessoa 2)'\",\r\n \"Tag\": \"pane\"\r\n }\r\n ],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": false,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"pane\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\2448c60c-d50a-4766-991b-7b67279a741a.png\"\r\n }\r\n ],\r\n \"Version\": 1\r\n}", "ImportMetadata": { "DisplayName": "Computador local", "ConnectionString": "", "Type": "Local", "DesktopType": "local" }, "Name": "appmask" } ], "ImageRepositorySymbol": { "Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}", "ImportMetadata": {}, "Name": "imgrepo" }, "ConnectionReferences": [] }