
Davgop
Active Members-
Posts
21 -
Joined
-
Last visited
Everything posted by Davgop
-
@TheXman - Okay I will have a look on the help file and learn more about the Autoit. If I need any assistance I will come to wise guidance.
-
@Earthshine - Appreciate your time and effort, below is the code. Sub Testt() Dim mate As New WebDriver, keys As New Selenium.keys mate.Start "chrome" mate.Get "https://google.com" Application.Wait (Now() + TimeValue("00:00:03")) Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.WinActivate "Google - Google Chrome" Application.Wait (Now() + TimeValue("00:00:03")) oAutoit.Send ("^p") End Sub
-
@TheXman - Thanks for the detailed explanation, let me explain the end to end project process. So you let me know if Autoit can help me completely. 1. Open, Login and navigate to a credentials portal (in-house built) and get all User credentials of the portals to checked 2. Segregate the customer for whom we need to check the supporting docs 3 Initiate the Loop to Open, Login, Find the customer, Check for relevant Document 4. If document not present then make a note of it against the customer 5. If document present then do CTRL+P and save the document 6. Then move the document to the a specified folder in a local drive and restart the loop 7. Post completion of Loop save the data (Customer checked and the document fetched status as Excel file) 8. Send an a Email with a default template. Thing need to be noted:- What will happen if the code encounters an error in the middle, will the data which was run until then can it go to step 6,7,8? How to initiate the process? When the process is running can the system be used (whether the user can use other application, like excel, word, browser, outlook and etc..)?
-
@TheXman - Apologizes for the delay in reply, I would really love to learn Autoit, however I need excel for this project because this is a repetitive task we need to store the details of the customers whom we have worked and not. so as the Loop runs for each customer I have added status of the fetch in the adjacent column (like- Document saved, Document not found, Document not relevant) and after the Loop is finished the same data will be exported to an Email and a copy of the sheet will be saved for future references.
-
@TheXman - No in excel we only have data of customer. From the portal we will download evidences in a pdf version. So once all the evidences downloaded for a customer then it will be moved from downloads folder to local folder with customer id as the folder name. Once this done it will move to the next customer. So to visit, login, navigate, and click print in each portal I use selenium web driver.
-
@TheXman - Yes I would love to learn the language. I was a bit frustrated about the questions and that was the reason. Let me tell you the whole history we do work for claims industry our job is to consolidate evidences from different portal to prove that the claim is genuine. The reason I'm using Excel is as we have different portals and this has to be done repeatedly for all customers, we have data for each customer in the excel file to fetch the exact data from the portals. So i have 500 customers data and created FOR LOOP so once it downloads first customer then it moves to the next.
-
@seadoggie01 @TheXman - Thanks for your suggestion, based on you guidance. I have tried the below code but still no luck. Sub Tessst() Dim mate As New WebDriver, keys As New Selenium.keys mate.Start "chrome" mate.Get "https://google.com" Application.Wait (Now() + TimeValue("00:00:03")) Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.WinActivate "Google - Google Chrome" Application.Wait (Now() + TimeValue("00:00:03")) If oAutoit.WinWaitActive("Google - Google Chrome", "", 3) Then oAutoit.Send ("^p") Else MsgBox "Window not found" End If End Sub
-
@TheXman - I am really not one of those guys. Honestly I do not have any experience in programming or automation, the code I used is from this website I think I can change the string bot into any desired name as it is a declaration (see below code as I have changed the same). Purely my intention is to automate a manual task, My role is a Team manager and this automation is my added skill. The reason why I am using "google.com" is because I cannot share the URL as I stated earlier. Please do let me know what should I do to prove that I am not a unethical person So I tried to .wait option of VBA, but still no luck. Sub Testt() Dim mate As New WebDriver, keys As New Selenium.keys mate.Start "chrome" mate.Get "https://google.com" Application.Wait (Now() + TimeValue("00:00:03")) Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.WinActivate "Google - Google Chrome" Application.Wait (Now() + TimeValue("00:00:03")) oAutoit.Send ("^p") End Sub Also with the help of the below code based on this thread I am able to open browser click CTRL+P and the print window pop up. However unable to click enter. Sub Teset() Dim mate As New WebDriver, keys As New Selenium.keys mate.Start "chrome" mate.Get "https://google.com" Application.Wait (Now() + TimeValue("00:00:03")) Call Autoit End Sub Sub Autoit() Dim AutoItPath Dim FileName As String Dim FileName1 As String FileName = "C:\AP\Praise.au3" AutoItPath = "C:\Program Files (x86)\AutoIt3\AutoIt3.exe " FileName1 = """" & AutoItPath & """" & " " & """" & FileName & """" runScript = Shell(FileName1) End Sub
-
@TheXman - With the below code I am able to open notepad, type "HI" and Print it. However I did the same in my actual code but still it does not work. I am not getting any error the code runs fine but the Print window is not popping up. Sub Test() Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.Run "Notepad.exe", "", oAutoit.SW_MAXIMIZE oAutoit.WinActivate "Untitled - Notepad" oAutoit.Send ("Hi") oAutoit.Send ("^p") oAutoit.WinActivate "Print", "Print" oAutoit.Send ("!p") End Sub Actual code: Sub Tessst() Dim bot As New WebDriver, keys As New Selenium.keys bot.Start "chrome" bot.Get "https://google.com" Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.WinActivate "Google - Google Chrome", "Chrome Legacy Window" oAutoit.Send ("^p") End Sub
-
@TheXman - Thanks a lot for your assistance and patience, with the code you supplied I am able to open notepad and maximize it. So I tried to type something in the notepad and click CTRL+P, however it all happens in the VBA editor window. So I think we activate the notepad window, could you please help me. Sub Test() Dim oAutoit As AutoItX3 Set oAutoit = New AutoItX3 oAutoit.Run "Notepad.exe", "", oAutoit.SW_MAXIMIZE oAutoit.Send ("Hi") oAutoit.Send ("^p") End Sub
-
@TheXman - Apologize for the misunderstanding. I have run the script file mentioned in the below path and both works fine. Just to let you know I followed the instructions provided in this link and I able to attain my results with below code. I am not sure if i could access this executable script file using VBA.
-
@TheXman - Here is the error message. Sub Test() Set oAutoIt = WScript.CreateObject("AutoItX3.Control") 'getting error on this line oAutoIt.Run ("notepad.exe") End Sub
-
-
@TheXman - Thanks for your help. I have registered using the below guide. It was successful registered. so now I tried the example in the help file but still getting the same error. Sub Test() Set oAutoIt = WScript.CreateObject("AutoItX3.Control") 'getting error on this line oAutoIt.Run ("notepad.exe") End Sub
-
@TheXman - I am afraid I did not do that, could you please let me know how to do it. If you are referring to add the reference in VBA (see screenshot below) yes I did that.
-
I am also using Office 365 and it does allows VBA in excel
-
@Earthshine I apologize for not answering your question in the previous comment. So as I stated in my earlier comment I am running a automation project where it will open up a browser and goes to a specific URL (I cannot share this URL as it is against my company rules) and login with the user credentials, navigates to a specific page and clicks on the button which says print. so after this the chrome Print properties option gets displayed and I need to click the Print option. This is manually task we do on daily basis once the document id downloaded we need to upload it in our data base. All these portals are IP restricted and can only be used through company's IP. Also, yes I have gone through the Forum rule. I am not doing anything which is illegal or bypassing the terms and conditions. I have created many automation projects using VBA and selenium and this is first time I am facing this task. I believe that I have answered your question, please do let me know if you need anything else.
-
@Earthshine - Here is the code I tried but I am getting an error. Sub Test() Dim bot As New WebDriver, keys As New Selenium.keys bot.Start "chrome" bot.Get "https://google.com" AutoItX.send ("{^p}") 'getting error on this line End Sub
-
@Earthshine I have gone through the Links you provided, however I lack the knowledge of the understanding the concepts. I have to say I am a beginner and I do not have programming/development background. So what I am doing now is, with the code below I am opening up chrome and visiting google.com. what I want to do is use sendkeys option to press "ctrl+P" and then click the "Print" button. Could you please assist me on the same. Here is the code: Sub Test() Dim bot As New WebDriver, keys As New Selenium.keys bot.Start "chrome" bot.Get "https://google.com" 'code needed for "ctrl+P" End Sub I am using VBA and selenium
-
Earthshine - Thank you for your response. I am very new to programming, so basically I am working on an automation project to open a URL, login with the credentials, navigate to the specific page and click the print button. I am using VBA with selenium binding and chrome browser. Now, after I click the print button in the webpage the print option of chrome browser pops-up. All I need to do now is click the print button, but with VBA or Selenium I unable to attain my results. I learnt that using Auotit I can automate click function. so I was trying the example given. It would really helpful if you give any advice or show me the direction.
-
I am trying to use Autoit was based on this website instructions I have installed Autoit added the reference in VBA. But when i run code it gives me an error as "Class Not Registered" I am using office 365 with windows 10. The error occurs in the line where i set the object. Sub autoit() 'Create and initialize an object Dim autoit As AutoItX3 Set autoit = New AutoItX3 'Check autoit installation If IsNull(autoit) Then MsgBox "Autoit Is Not installed on your machine", vbCritical + vbOKOnly, "Verify" Exit Sub End If 'Launch Calculator autoit.Run "calc.exe", "C:\Windows\System32" autoit.Sleep "2000" If autoit.WinExists("Calculator", "") Then 'Click Button "1" and wait for one Second autoit.ControlClick "Calculator", "", "131" autoit.Sleep "1000" 'Click Button "+" and wait for one Second autoit.ControlClick "Calculator", "", "93" autoit.Sleep "1000" 'Click Button "2" and wait for one Second autoit.ControlClick "Calculator", "", "132" autoit.Sleep "1000" 'Click Button "=" and wait for one Second autoit.ControlClick "Calculator", "", "121" autoit.Sleep "1000" 'Close the calculator autoit.WinClose "Calculator", "" End If End Sub