Sahi Pro v7.0.0 Java Language Driver Changes
abstract
Sahi Pro's java language driver had been lagging behind Sahi script in implementation of APIs.
We have now completely rewritten the Java driver such that new APIs are autogenerated and does not need maintenance.
This has forced some deviations from the current Java driver.
- All APIs in Sahi (including Desktop Add-on APIs) are now exposed in Java driver.
net.sf.sahi.client.Browser
class has changed package tocom.sahipro.lang.java.client.Browser
b.getWindows()
returnsList<Map<String, String>>
instead ofList<HashMap<String, String>>
b.getScreenSize()
returnsInteger[]
instead ofint[]
b.select("...").selectedText()
changed tob.select("...").selectedTexts()
andselectedTexts()
returnsString[]
b.lastAlert(true)
replaced withb.lastAlerts()
b.lastConfirm(true)
replaced withb.lastConfirms()
b.lastPrompt(true)
replaced withb.lastPrompts()
- No need for "_sahi." prefix when invoking Sahi code on browser
b.fetch("_sahi._isIE()")
can be written asb.fetch("_isIE()")
b.execute(sahiCode)
has becomeb.executeSahi(sahiCode)
b.collect(templateEl, "attribute")
has becomeb.collectAttributes(templateEl, "attribute")
b.takeScreenShot("D:\\abcd.gif", "gif", 50)
has becomeProperties props = new Properties(); props.put("format", "gif"); props.put("resizePercentage", 50); b.takeScreenShot("D:\\abcd.gif", props);