CGI Scripts display as text on OSX 10.9 - scripting

These scripts executed perfectly on "Lion". When I upgraded to "Mavericks" they only display as text. The scripts still execute (from the command line) perfectly, but when called from the browser you get the text (not the web page that it should be generating).
A simple step-by-step would be greatly appreciated.
Thanks!

I assume you are trying to run these in a browser? Have you made sure that the web worker executing the script has the correct level of permissions required to do so?

Related

Testing frontend webpages solve selenium-ide issues or change to so?

i'm using selenium ide to test webapp frontend webpages.
I'd like to test via cli AND via gui having to mantain one scripts only.
When automating tests via selenium-side-runner it does not handle alert/confirm command if i don't change any "choose ok on next confirmation" with "webdriver choose ok on visible confirmation", but after change it side gui does not handle it.
Even exporting to python has some incokmpatiblity with gui.
Anyone knows the proper way to record a side.script with gui and run with cli without having to modify it and letting run the tests with the gui again?
I've see many complaining about this without solution, do you advise to use another fronted tester in the place of side? Why?
Thanks.
Just reporting what said on github's bug tracker issue 1270 by toddtarsi.
There's no way to have one script only to handle gui and cli tests. We have to wait for selenium-ide v4 (not SELENIUM).
The correct way is webdriver one.

Can we customize Chrome browser launch with different options using Chrome Java API? [duplicate]

I am using the Karate framework to do the API testing. As part of CI efforts, we send an email at the end of test execution listing the summary of test results. There is a need to include the screeshot of the test execution counts from 'overview-feature.html' file.
I did so through the TestRunner.java file - launched Chrome using Chrome.start() and then using it to take screenshot. It all works well locally on Windows.
However when executing on CI server which is a Unix box, the chrome executable is not present in the default location (usr/bin/google-chrome) and hence the connection for the localhost fails.
Is there a way we can change the default location of the chrome executable?
PS: Apologies if this was too trivial to be asked.
Yes Chrome on CI is hard to get right, refer: https://stackoverflow.com/a/62325328/143475 - note that CI boxes typically are "headless" a browser may not be even installed.
I think the best thing for you is to ZIP the HTML and send it. But I really think you need to work with some CI experts, because the report generation and e-mailing business is normally done by things like Jenkins. What you are doing is certainly not normal or best-practice.
If you really want, there is a Karate Docker container that can give you a proper Chrome instance (see docs) but that is overkill for what you need.
EDIT: The Chrome Java API allows for customization of the executable path and this is in the docs: https://github.com/intuit/karate/tree/master/karate-core#chrome-java-api
It should be something like this:
Chrome.start("/opt/blah/chrome");

Refresh command not present in Selenium IDE

I am a beginner to selenium and have downloaded and installed the IDE. I'm following some tutorials and although at least some commands work (I can go to google and search for something), for some reason not all commands are available in the IDE and I have no idea why.
I tried restarting my browser and my computer, but the refresh command isn't part of the dropdown. I also tried manually typing Refresh as a command in the ide, but I get an error message saying: Unknown command refresh. See image
here
Thanks!
You can use executeScript command and use Javascript to refresh the page.
There are multiple ways of using JS Refresh detailed here

Google Chrome file system api: bug in sample code?

I am trying to run this example code:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/filesystem-access
as well as this:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/storage
I am not able to get either of them to run in my browser: Chrome 26.0.1410.65 Mac Lion 10.7.5
(to see it run, download it and click on html page included with each of the examples)
If you can confirm this is a bug in the sample code (it doesn't run in your system as well) please let me know where I should file this bug report. (https://code.google.com/p/chromium/ or https://github.com/GoogleChrome/chrome-app-samples/issues?)
many thanks in advance.
You need to use the Load unpacked extension button found on the chrome://extensions page and then launch the app in order for it to use chrome.* API's.

Trouble using ssh in a Mac Automator Service

I am trying to create an Automator Service that runs an applescript that eventually runs a bash script to ssh/scp to a server:
--
I have this applescript that saves my current photoshop document and calls a bash script to scp the image to a server. The bash script then runs ssh to do some stuff on said server with the image.
I have an ssh-askpass file and it seems to work well in most situations. I even tried reinstalling it to make sure I didn't goof on permissions, but it seems to be in good shape.
If I just run the applescript through Applescript Editor, it works fine and goes through ssh-askpass.
I want to create an Automator action (using the "service" template) to run my applescript, so I can just make it into a keyboard shortcut.
If I just run the script in Automator, everything works fine. Unfortunately, when I try to use the service outside automator (ie App Menu > Services), it seems that my Automator action is not attempting to go through ssh-askpass at all (which I verified with temporary logging)- everything works fine up to that point.
I looked into it a bit more, and it appears that a similar issue occurs when I try to run the applescript from the terminal (and not Applescript Editor)
--
Is there something different I need to do to ensure that an applescript (in Automator) uses ssh-askpass?
I found the issue. In the bash script I was calling, I was exporting the SSH_ASKPASS path, but not the display:
export DISPLAY=":0"
Apparently the AppleScript Editor (and XCode and Automator) does the exports for you, which is why it was working in those cases.
If you have control over your account on the server (e.g. shell account), I would just generate an SSH keypair and use it for authentication. That way, you can truly automate the exchange and not have to deal with ssh-askpass at all.
See http://paulkeck.com/ssh/ for a guide to making and deploying SSH keys.