We’re going to show you how to locate the image files that are contained within the Photos app on Mac OS. This is specific to Photos app, if you don’t use the Photos app to manage pictures on your Mac then your photos will not be stored within the applications package library and instead you’d likely find them through Finder in the generic Pictures folder or elsewhere in Mac OS. The text file as executable (rather than give it a specific suffix). This is how OS X does it. However, OS X adds the feature that if you give the file the suffix.command, Finder will run Terminal.app to execute it (similar to how BAT files work in Windows). Unlike MS-DOS, however, UNIX (and OS X) permits you to specify what interpreter is used. For people with guru crash – change operating system from mac os x 64 El CAPITAL to just the mac os x 64. Mukhtar Jafari Post author May 5, 2017 at 7:41 AM Reply. Benny May 19, 2017 at 9:46 AM Reply. Thanks, This worked for me. Mat May 26, 2017 at 8:10 AM Reply. Martinicus August 9, 2017 at 12. Creating a bash shell script works like in all.nix operating systems. Create a text file containing the command - i.e. Make file executable using chmod - i.e. Chmod 755./command.sh.
Home›Sahi - Open SourcePlease note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.
edited June 2010 in Sahi - Open Source
Hi All,
I went through the following post and created batch mode execution of multiple test cases on Windows it does works fine. http://sahi.co.in/w/Running+multiple+tests+in+batch+mode
But, I need to create a similar batch mode execution on Mac. For example, if we consider safari browser:
java -cp ..libant-sahi.jar net.sf.sahi.test.TestRunner 'C:SahiuserdatascriptsVita_G3_FrameworkTest_ScriptsExecution.suite' 'C:Program FilesSafariSafari.exe' 'http://s2k3-2106'; 'C:SahiuserdatascriptsVita_G3_FrameworkResultsSafari' Localhost 9999 1 'Safari.exe' 'Safari.exe' '-noframemerging'
I tried changing the directory to '/Users/VCadmin/Sahi/userdata/scripts/ ect /ect' and execute on Mac terminal, But this does not work.
How can i modify it to run on Mac machine? [ Since, C: and stuff don’t work on Mac]
I went through the following post and created batch mode execution of multiple test cases on Windows it does works fine. http://sahi.co.in/w/Running+multiple+tests+in+batch+mode
But, I need to create a similar batch mode execution on Mac. For example, if we consider safari browser:
java -cp ..libant-sahi.jar net.sf.sahi.test.TestRunner 'C:SahiuserdatascriptsVita_G3_FrameworkTest_ScriptsExecution.suite' 'C:Program FilesSafariSafari.exe' 'http://s2k3-2106'; 'C:SahiuserdatascriptsVita_G3_FrameworkResultsSafari' Localhost 9999 1 'Safari.exe' 'Safari.exe' '-noframemerging'
I tried changing the directory to '/Users/VCadmin/Sahi/userdata/scripts/ ect /ect' and execute on Mac terminal, But this does not work.
How can i modify it to run on Mac machine? [ Since, C: and stuff don’t work on Mac]
The Useless Bat Mac Os 11
![The The](https://www.cyberciti.biz/tips/wp-content/uploads/2009/08/Alpine-Linux-Unix-macOS-email-Client.jpg)
![The The](https://i2.wp.com/9to5mac.com/wp-content/uploads/sites/6/2018/10/Touch-Bar-a-gimmick.jpg?resize=1200%2C628&quality=82&strip=all&ssl=1)
The Useless Bat Mac Os Catalina
Comments
The Useless Bat Mac Os Pro
- Hi Narayan,
Can you please give a example as to how to execute a test Suit on Mac OS X. I went through the documention and examples provided by sahi. Most of the examples are only for Windows. There are not many Mac or Linux examples.
It would be really helpfull, if we have examples or documentaion for Mac and Linux also. - Hi Wasim,
As stated here: http://sahi.co.in/w/Running+multiple+tests+in+batch+mode, you need to use the correct paths to the Safari executable
Try:
If 'open -a Safari' does not work, try with 'open' or '/full/path/to/Safari'
Regards,
Narayan - edited June 2010Thanks Narayan Open -a works.
For other sahi users commands to work on Mac:
switch over to sahi bin directory:
cd sahi
cd bin
Safari Browser:
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a Safari' 'http://s2k3-2106.local/' 'scripts/Vita_G3_Framework/Results/Safari' Localhost 9999 1 'Safari' 'Safari' '-noframemerging'
Firefox Browser:
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a Firefox' 'http://s2k3-2106.local/' 'scripts/Vita_G3_Framework/Results/Firefox' Localhost 9999 1 'Firefox' 'Firefox' '-profile browser/ff/profiles/sahi$threadNo -no-remote'
Chrome:
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a 'Google Chrome' ' 'http://s2k3-2106.local/' 'scripts/Vita_G3_Framework/Results/Chrome' Localhost 9999 1 'Google Chrome' 'Google Chrome' '--user-data-dir=$userDir/browser/chrome/profiles/sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking'
[For Chrome - You need to use (open -a 'Google Chrome') in single quotes]. Ensure your proxy settings are set right.
Batch mode execution works on Mac. - Thanks a lot wasimhbr for contributing back : )
Regards,
Narayan - Hi,
Thanks for the usefull tips for using Sahi on MAC. It works great!
I am still facing an issue using sahi in batch mode on MAC. The firefox profiles doesn't seem to work as the proxy settings are not done automatically when using the batch mode. Also I tried running Sahi on Safari but am getting out of memory error. I am sure I am missing out something. Please share if you have any insights.
Regards,
Pankaj Kumar - Hi Pankaj,
You hit the same error as i got it. Even i struggled with this error. To be honest, i dono what’s going wrong here. I feel there might be something in depth we are missing or there might be a bug in Sahi or its something silly we are missing. (Narayan can put a light on this).
First Part:
I will tell you what I did to overcome this:
1. Stop sahi proxy server.
2. Change settings on safari such that it does not use proxy server.
3. Close the browser.
4. Launch browser and connect to some website like google.com
5. Once google launches without using proxy server.
6. Don’t close the browser, change back ur browser settings to use sahi proxy server .
7. Go back to the terminal and start sahi.sh file from bin directory.
8. Now launch you application, It will not throw Java out of memory error on console.
9. Once its starts working then any number of times you can open and close browser no-issues.
Second Part:
When you are running scripts on windows you just call batch file which remains in the same bin directory until it completes execution on all browsers. But that’s not the case with Mac.
After you complete execution on one browser, you need to set back the execution path to bin directory:
I am sharing the code for .sh file i had written for my application:
_________________________________________________________________
#!/bin/bash
echo 'Executing Automation Suite'
cd ~
cd Sahi/bin
echo 'Execution on Safari'
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a Safari' 'http://s2k3-2106.verdad.local/' 'scripts/Vita_G3_Framework/Results/Safari' Localhost 9999 1 'Safari' 'Safari' '-noframemerging'
echo 'Execution on Firefox'
cd ~
cd Sahi/bin
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a Firefox' 'http://s2k3-2106.verdad.local/' 'scripts/Vita_G3_Framework/Results/Firefox' Localhost 9999 1 'Firefox' 'Firefox' '-profile browser/ff/profiles/sahi$threadNo -no-remote'
echo 'Execution on Google Chrome'
cd ~
cd Sahi/bin
java -cp ../lib/ant-sahi.jar net.sf.sahi.test.TestRunner 'scripts/Vita_G3_Framework/Test_Scripts/Execution.suite' 'open -a 'Google Chrome' ' 'http://s2k3-2106.verdad.local/' 'scripts/Vita_G3_Framework/Results/Chrome' Localhost 9999 1 'Google Chrome' 'Google Chrome' '--user-data-dir=$userDir/browser/chrome/profiles/sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking'
echos 'Completed execution on all 3 browsers'
cd ~
cd Sahi/userdata/Scripts/Vita_G3_Framework/Test_Scripts - (Replace this with your path)
_____________________________________________________________________________
You can execute this script from any where but change the paths accordingly.
Launch firefox manually once and check if is it launching. while scripting be carefull with case. Mac is case sensitive.
We can successfuly do a batch mode execution, Give a try !! - Hi wasimhbr,
Thanks for your valuable inputs. I tried the steps you have suggested but it is not working for me. The strange thing is that I was able to execute my scripts individually through the Sahi controller earlier. After I tried my hands on batch execution using sahi suites I started getting the errors like:But now i get the same error even if try to execute a single script through the sahi controller.
This is happenning on both Firefox as well as Safari.
I also tried fiddling with the heap size using the -Xms and -Xmx parameters.
I updated my sahi.sh like this:Please let me know where I am doing it wrong or any suggestions/workrounds.
This error message provided here is just a snippet of the long error message. I can mail the complete error message if needed.
Regards,
Pankaj - Hi,
Got the problem resolved for the single script execution through Sahi controller.
Honestly speaking the problem is still not clear to me but what I did was update Java, restart the MAC, and download fresh copy of Sahi. This worked for me. Now I will try to work upon the suite/batch thing. Lets see which way the cookie crumbles!
I will keep posting my findings.
Regards,
Pankaj Kumar - Guys the problem of outofmemory is because of how Java uses proxy settings on Mac.
We configure the browser to use Sahi as its proxy.
On Mac, Java uses the system wide proxy. So now, Browser and Java both use Sahi as its proxy. (What wasimhbr noticed. If you configure the proxy and then start Java, it will use Sahi as its proxy too. If you change the proxy after starting Java, then things are fine)
It should have been
browser -> Sahi -> Java (urlconnection) -> Website
but it has become
browser -> Sahi -> Java (urlconnection picks Sahi proxy now) -> Sahi
This is where the recursion comes in.
To fix this, open userdata.properties and set these properties:
Basically we are forcing Java to use a direct connection here.
Let me know if this fixes your issue.
Regards,
Narayan - Thanks Narayan!
I tried the same and was able to execute the batch/suite. But I had to keep
ext.http.proxy.enable=false
and also had to follow the sequence mentioned by wasimhbr. The only challenge remaining is to use profiles to automatically set firefox proxy settings.
I have the following shell script that will automatically invoke sahi proxy and then launch the suite runner:This works fine if I have already set the Firefox proxy to point to localhost:9999
But the suite execution on Safari through my shell script still gives the out of memory error.
Regards,
Pankaj Kumar - Hi, i'm trying to launch suites on MAC OS X, too (i have 10.6.3) and i'm experiencing problems, though i've read instruction and this post carefully and tried to do all according to them.
For example, i'm trying to run test under Safari (running from sahi/bin dir):
after this, i'm getting a message from which i think that everything is right in syntax:
In other terminal tab, where Sahi server is running, i get:
So suite file was accessed and Sahi tells that it's running scripts, but browaser not opens and nothing happens.
After some time, a log file appears telling:
I'm not getting any other error messages so i don't understand what exactly i make wrong. Can you please help me? ( i removed site URLs from post because forum not allows me to post them) - edited July 2010btw i've tried absolute path to browser as well (/Applications/Safari.app/Contents/MacOS/Safari) and tried the same for FireFox and Chrome, with same effect.
- There are couple of things that might be causing this:
1. If you are trying on Safari Browser, you need to change the browser security settings to always accept cookies.
2. Just have a look at relative paths.
3. Try launching browser from terminal and check whether you are able to launch your application.
4. Execute a single script before running a batch script.
5. Re-verify the Sahi proxy settings. - Hi, i've re-checked all of these several times and i sure in all settings and paths, running 'open -a Safari' or 'open -a Firefox' in terminal also works. Running single script is not working too (but works manually through Sahi tool)
- Hi,
Do ensure that you have followed the instructions provided by wasimhbr (post #7 in this thread) and Narayan (post #10 in this thread).
Regards,
Pankaj - Hi Psylence,
For Safari, browserOptions should be blank.
Regards,
Narayan - Hi,
I want to do the following on MAC+Safari:
1. Write a shell script that does the following:
> Launch the sahi proxy as a background job
> Run a suite
Now my problem is that if I follow the mentioned sequence I have to first manually set Safari to use sahi as its proxy listening at port 9999. Now if I execute my shell script it goes into an endless loop resulting into Out of memory error. I tried all the suggestions given above, but in vain.
Please give some suggestion.
Regards,
Pankaj Kumar - Hi all,
i moved a step further but i still cannotmake things working for me.
FIrst, browser finally opens (that's good), but only if browserOptions is empty (that relates to FireFox, too, not only to Safari)
Second, when i set proxy options in Safari (on MacOS these are global system proxy options) i getting the same out of memory error already described above. So i'm able to use only FF.
Third, and the worst problem is that Sahi ignores port for some reason when i'm trying to run batch job. I mean, i'm using port 3000 to run my local application that i test and i'm providing URL with port when runnning batch job, but after opening browser, Sahi tries to open URL without port (and of course, cannot reach application). I think it's a bug.
Regards, psylence - Hi again,
I finally managed to run tests, by changing my app port from 3000 to 80, but i still think that it would be greate for Sahi to support custom ports in batch mode, as many developers use them.
psylence