Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » how to give a path on java on Mac
how to give a path on java on Mac [message #1074403] Fri, 26 July 2013 17:21 Go to next message
shiva r is currently offline shiva rFriend
Messages: 1
Registered: July 2013
Junior Member
We're learning file input and output in my programming class right now, but I have a Macbook Pro. I understand how to do it and I can do it on Windows but I'm having trouble finding out how to do it exactly for a Mac.

package selenium_pack;
import java.util.Properties;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class Properties_File_Example {

public static void main(String[] args) throws IOException {

WebDriver wd= new FirefoxDriver ();
Properties p = new Properties ();
FileInputStream f = newFileInputStream("//Users//mymac//Desktop//Selenimprojects//WD//src//selenium_pack//ObjectRepository.txt");
wd.findElement ("un"))).sendKeys("username");
wd.findElement ("pw"))).sendKeys("password");
wd.findElement ("lin"))).click ();



Data in the file named ObjectRepository


( This works perfectly fine when i run this program in windows xp)

Error Message

Exception in thread "main" /Users/mymac/Desktop/Selenimprojects/WD/src/selenium_pack/ObjectRepository.txt (No such file or directory)
at Method)
at selenium_pack.Properties_File_Example.main(
Re: how to give a path on java on Mac [message #1075240 is a reply to message #1074403] Mon, 29 July 2013 05:15 Go to previous message
Aaron Skelsey is currently offline Aaron SkelseyFriend
Messages: 4
Registered: July 2013
Junior Member
I'm not a Mac user, but I understand it is essentially UNIXy
If you go to a terminal window and type:
"cat /Users/mymac/Desktop/Selenimprojects/WD/src/selenium_pack/ObjectRepository.txt"
does it show the contents of your file?
Previous Topic:How to create .apk by importing gideros android project
Next Topic:app to computer?
Goto Forum:

Current Time: Sun Mar 07 21:44:29 GMT 2021

Powered by FUDForum. Page generated in 0.03017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top