I am trying to automate web form data entry by using selenium VBA. We need to submit the forms on our organization SharePoint site, which requires us to log-in. I have already logged into the account. Please see the code below. Whenever I open the page (last step), there is a pop-up window asking me to enter the username and password again. I need to pass this step in order to get to the form that I want to enter all my information. I am not quite sure if this is an extra security that our IT team set up, but I could not inspect the page. I have included a screenshot here. I am hoping to inspect the pop-up window somehow so that I could use FindElementById. Thank you in advance for your reply.
obj.Start "chrome", ""
obj.Get "link"
obj.FindElementById("passwordInput").SendKeys ("password")
obj.FindElementById("submitButton").Submit
obj.FindElementById("idSIButton9").Submit
obj.FindElementByClass("reg-button").Click
obj.Wait ("1000")
obj.FindElementByXPath("//div[#id='slwp_ctl00_ctl41_g_f6ad5b95_2503_406f_ad81_eb5b3f59cad2']/div/div[3]/ul/li[10]/div/a").Click
I had a similar issue. However, in my case the dialog box was coming even before the login page was displayed.
The solution to the issue is given here
Maybe something similar will help for you. Please try following steps.
I am not sure of the syntax in VBA. But these steps should help you.
Get the current URL.
In java this can be done by using the getCurrentUrl() method of WebDriver interface.
Modify this current URL to include username and password.
The modified URL should be of in the following format:
http://username:password#example.com/
In java, this can be done by using the various methods of String class,
Submit the modified URL.
In java this can be done by using the get(String URL) method of WebDriver interface.
Related
I'm developing an application in MS Access, using VBA.
The application already exists but I have to add a button and a piece of code in a form.
The problem is that, when I add the button and try to show the form, I don't receive an error but the form isn't visible.
I'm sure that the form is open, because, if I try to delete it, I receive an error that tells me that is not possible to delete an opened form.
Can anyone tells me the solution?
Edit: I still have the same problem on another form in my application. The form worked since i add a piece of code in it. Now, also deleting the code it doesn't work... I've also tried to decompile the application but nothing changed...
The following function has several arguments for show/hide etc. With the correct parameters you should be able to get that form to be visible:
OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)
All the argument options can be found here.
I'm using a PHP script which expects user input from a command like fgets(STDIN). The problem is it no longer works in the newest version of PHPStorm (10).
The same works when I run it directly (without debugger enabled) and anything I enter in the console is sent to the script (on direct run).
But during a debug session, when I try to input text at the script's prompt, it does not go to the script. My best guess is that the new REPL feature is overriding user input in console during debugging. I say this because pressing the UP/DOWN arrows opens up a popup with all PHP function names.
It used to work correctly with last version.
How can I send user input to my PHP script with this new version? Am I missing something here?
I'm not sure if this is the same thing, but I was running into this same problem, and I was able to get it working by deselecting the "Use Console Input" checkbox in the PHPStorm Console.
John's answer is perfect.
I want to mention that the Use Console Input is a tiny icon in sidebar of the debug console. I provide you by this image
I currently have a app that manages projects. The user sees a list of projects and can select one. They can should (it would be nice) be able to click a run button and have another app open. The parameters stored in the project they selected are populated into the second application. The issue I am having is firing the second application. runApp generates the following.
ui code line:
actionButton("RunProj", "Run"),
Warning in run(timeoutMs) :
Unhandled error in observer: Key / already in use
observeEvent(input$RunProj)
I would like to trigger the second app and pass in the location of the project directory I have looked at parseQueryString and still trying to figure out a way to include that. Maybe via a redirect?
Any suggests would be much appreciated.
Regards,
Rich
I'm not 100% sure if I understand your intention correctly but here is a few things I think you may want to think about.
In one project, if you want to run a few kinds of analyses, you may want to try navbarPage
If there are many different types of analyses, you may want to try shinydashboard
If you know the link to each app and you really want to add those "run" buttons, you can add a button manually in ui.R. I think you can write some codes in server.r to generate the link based on your database.
tags$a(href="the link to your apps", class= "btn btn-default", "Run App")
I followed the suggestion by Cody Gray about halfway down the page in this thread but I'm having no luck.
Unless I'm missing something, this is supposed to allow me to navigate from Access, using the Windows API Dialog Box, to the relevant folder and open a file, no? I'm trying to open a Word doc which has a Mail Merge coming back to the same Access Db. I needed the dialog because there are multiple files that may be selected at different times.
I added all the suggested code and while the process runs without error, when I get to the final step, the selected file doesn't open. Nothing happens.
I realize this is not much help without an error message. Any thoughts nonetheless?
As I understand the situation, you have code which uses a string variable named strFileToOpen to hold the path to a Ms Word document. And now you want to open that file in Word.
You can use the FollowHyperlink method.
Application.FollowHyperlink strFileToOpen
Look at the Access help topic for that method. It offers other options you may wish to use.
Also I suggest you look at the help topic for FileDialog Object. It is simpler than the Windows APi method in the code you linked.
I have created a script that logs into a website, but now I need help. Here is the main script that logs me in, pretty self explanatory.
WebBrowser1.Document.GetElementById("login").SetAttribute("value", txtUsername.Text)
WebBrowser1.Document.GetElementById("passwd").SetAttribute("value", txtPassword.Text)
WebBrowser1.Document.GetElementById("SI").InvokeMember("Click")
Now, what I am trying to do is make it tell me if I have used the right log in or not (the website i'm using is live.com). So obviously I'm going to need something that can read the page, and if it finds this "That Microsoft account doesn't exist. Enter a different email address or get a new account." or this "That password is incorrect. Be sure you're using the password for your Microsoft account." then it should say something along the lines of this in a message box: "Could not log in". But if it's successful it should read something else, and also redirect it to a page. Can anyone give me any references or tips on how to start this?
Use a browser's developer tool (for example, Firefox's Ctrl-Shift-I) to see the ID of the error message (in this case, "idTd_Tile_ErrorMsg_Login").
Then try WebBrowser1.Document.GetElementById("idTd_Tile_ErrorMsg_Login"). If that element's content is empty, there is no error message and login succeeded. Also, when you log in the page changes. So you can observe changes in the page URL, or see if the element (idTd_Tile_ErrorMsg_Login) can not be found.