Use Automator / AppleScript to select checkboxes and click buttons in Safari - button

Bitten off more than I can chew with this one. It's my first time trying to use AppleScript to automate Safari (while at the same time trying to figure out HTML). I've found examples to show me how to do this and have made it work for some very simple websites, but can't make it work for the website I'm trying to use.
I'm trying to navigate this website https://app.ssm.gov.mo/healthPHD/ using Automator with AppleScript commands.
On the third page in, when I go to the Safari console and input something like document.getElementById('btnSubmit').click() to submit the form, it works just fine.
However, when I add an AppleScript command in Automator as follows, it doesn't work:
tell application "Safari"
activate
tell document 1
do JavaScript "document.getElementById('btnSubmit').click();"
end tell
end tell
Also, I'm aware of the command document.forms[0].elements[0].checked=true for selecting checkboxes, but this doesn't seem to work for the checkboxes on this website as they are nested within the various Frames and Div parts. How do I go about navigating the frames and divs so as to select some of the checkboxes on this website before issuing the submit command?
Thanks.

Related

How to precisely test if CSS final computed values have changed anywhere on a page?

I have a situation where I need to merge several classes manually. They contain a huge amount of overrides within an 18,000 line CSS file.
I started making some changes to the huge CSS file and I realize that CSS loads the last case of a property so I did this all very carefully. For the most part things worked well. But, I did find one icon that was wrong and one text link that was the wrong font. So I thought, is there a way that I can compare the before and after state of this work precisely. I don't mean visually. But instead like two full text output files of the results of the computed CSS for the entire current page so I can run a compare on them in notepad++
Sorry if this is an ignorant question as I am a self taught web novice.
You can use notepad ++ to compare two files. You will need a compare plugin to be installed in notepad ++. Please follow the steps below:
Install the Compare Plugin
1. Launch Notepad++.
Click the “Plugins” menu, select “Plugin Manager” and click “Show Plugin Manager.” A list of currently available plugins populates the plugin manager screen.
Check the box next to “Compare.”
Click the “Install” button at the bottom of the screen. The Compare plugin will download and install. If an administrator authentication dialog appears, click the “Allow” button.
Using the Notepad++ Compare Plugin
1. Launch Notepad++ and open the two files you wish to run a comparison check on.
Click the “Plugins” menu, select “Compare” and click “Compare.” The plugin will run a comparison check and display the two files side by side, with any differences in the text highlighted.
Reset to the original window configuration and appearance by clicking the “Plugins” menu, selecting “Compare” and clicking “Clear Results.”
For reference click here

fields/column logical names of webpage to be checked

How can I get the fields logical names of webpage to be tested so that I can write script in Robot Framework.I understand we use key words to check/validate the controls (input, out and images etc) as required. I am come from manual testing background so obviously need to know how does it all work in Robot Framework.
Every browser has developer tools which you can use to inspect the page. For example, on chrome and firefox you can press Control-Shift-I to open the developer tools window. On IE I think it's F12. From there you can inspect the elements that make up the page.
You can also simply ask the members of your development team to help you.

Xpath/Css/class search does not work when using protractor

I am fairly new to using protractor or using automation testing tools. I am trying to click a link on a website. The link or even a button on that page does not have an id tag. So I have tried several ways to click the button or any link on that page:
browser.driver.findElement(By.xpath('//[#id="navbar"]/ul[1]/li[1]/a')).click()
browser.driver.findElement(by.css('.btn.btn-primary.btn-xlarge')).click()
browser.driver.findElement(by.linkText('Get Started')).click()
I have tried many combinations than the ones listed above. Most of the times I get the error, no such element found. Any help is greatly appreciated. Have been struggling on this with no luck.

To open a webpage in a popup dialogue box from a windows application

In one of my projects i need to open my webpage(.aspx or .asp) in a popup dialogue box from a windows application.
i tried window.open(), but certainly its not giving me the desired output.
can anyone help me??
You're not giving us a lot of information (e.g., C#?, vb.net?, any contextual code relevant to the issue), but as sort of an all-purpose solution to this, you may want to consider using javascript to open the window. You can even run it from server-side by registering the script. I'd provide you with code, but I don't know what language you are using.

AutoHotKey to focus a Form in Microsoft Access 2010/2013

I would like to use AutoHotKey to bring an access database to the screen, then take focus on one form (the form is open, but there will always be multiple other forms open at the same time, additionally, the form in question could be stacked at the bottom) and then the rest can be done with custom shortcuts that only work in this form.
I am also open for other solutions to do the same job, mouse clicks is also a possibility but forms are not always in the same place on different computers and they can also be moved during a session.
This is what I have been testing so far:
Bring up the database with IfWinExist, [title of window]
Then I tried using ControlFocus, [ControllerName]
That did work, but the controllername changes depending on what other forms are open and in which order they where last clicked on.
I have made a screenshot:
Any help would be nice, my main problem is that I do not know what AHK can do and therefore I feel very limited.
In the place of WinTitle you can also use other parameters of the window, not only WinTitle. More about it here: http://ahkscript.org/docs/misc/WinTitle.htm
Also you can use ImageSearch to get coordinates of the window and use these coordinates to move window without WinMove like here: http://ahkscript.org/boards/viewtopic.php?f=6&t=4013

Resources