Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from teamcfadvance/korygorsky-master
Korygorsky master
- Loading branch information
Showing
4 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
component output="false" extends="WebDriver" { | ||
|
||
public ChromeDriver function init() { | ||
var driver = createJavaObject( | ||
"org.openqa.selenium.chrome.ChromeDriver", | ||
variables.serverLibPath | ||
); | ||
return super.init( driver=driver, driverType="Chrome" ); | ||
} | ||
|
||
public void function setChromePath( required string path ) { | ||
createObject( "java", "java.lang.System" ).setProperty( "webdriver.chrome.bin", arguments.path); | ||
} | ||
|
||
public void function setUseExistingChromeInstance( required string toggle ) { | ||
createObject( "java", "java.lang.System" ).setProperty( "webdriver.chrome.useExisting", arguments.toggle ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
component output="false" extends="WebDriver" { | ||
|
||
public PhantomJSDriver function init() { | ||
var driver = createJavaObject( | ||
"org.openqa.selenium.phantomjs.PhantomJSDriver", | ||
variables.serverLibPath | ||
); | ||
return super.init( driver=driver, driverType="PhantomJS" ); | ||
} | ||
|
||
public void function setPhantomJSPath( required string path ) { | ||
createObject( "java", "java.lang.System" ).setProperty( "webdriver.phantomjs.bin", arguments.path); | ||
} | ||
|
||
public void function setUseExistingPhantomJSInstance( required string toggle ) { | ||
createObject( "java", "java.lang.System" ).setProperty( "webdriver.phantomjs.useExisting", arguments.toggle ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,37 @@ | ||
component | ||
hint = "I provide a backward-compatible path to access (deprecated) SeleniumRC." | ||
extends = "SeleniumRC" | ||
{} | ||
extends = "SeleniumRC" { | ||
|
||
public Selenium function init( string driverType="", string driverPath="" ) { | ||
structAppend(variables,arguments,true); | ||
variables.sessionId = ""; | ||
|
||
setDriverByType( arguments.driverType ); | ||
|
||
return this; | ||
} | ||
|
||
public cfselenium.drivers.WebDriver function getDriver() { | ||
return variables.driver; | ||
} | ||
|
||
public void function setDriver( required cfselenium.drivers.WebDriver driver ) { | ||
variables.driver = arguments.driver; | ||
} | ||
|
||
public void function setDriverByType( string driverType="" ) { | ||
// just implement Internet Explorer and firefox for now | ||
if ( arguments.driverType == "ie" || arguments.driverType == "InternetExplorer" ) { | ||
variables.driver = new cfselenium.drivers.InternetExplorerDriver(); | ||
} else if ( arguments.driverType == "firefox" || arguments.driverType == "ff" ) { | ||
variables.driver = new cfselenium.drivers.FireFoxDriver(); | ||
} else if ( arguments.driverType == "chrome" || arguments.driverType == "googlechrome") { | ||
variables.driver = new cfselenium.drivers.ChromeDriver(); | ||
} else if ( arguments.driverType == "phantomjs" || arguments.driverType == "phantom") { | ||
variables.driver = new cfselenium.drivers.PhantomJSDriver(); | ||
} else { | ||
variables.driver = new cfselenium.drivers.WebDriver(); | ||
} | ||
} | ||
|
||
} |