Skip to content

Instantly share code, notes, and snippets.

public class wDriver {
...
private EventFiringWebDriver eventDriver;
@Required
public void setEventDriver(EventFiringWebDriver eventDriver) {
this.eventDriver = eventDriver;
}
private DefaultWebDriverEventListener2 listener;
@Required
public class DefaultWebDriverEventListener2 extends AbstractWebDriverEventListener {
//Log4j
private Logger logger = Logger.getLogger(DefaultWebDriverEventListener2.class);
@Override
public void onException(Throwable ex, WebDriver driver){
logger.info("Exception is: "+ ex.getMessage());
}
}
public class wDriver {
...
public WebElement wdFindElement(By method) {
WebElement webElement =null;
try{
webElement = getDriver().findElement(method);
}
catch(org.openqa.selenium.NoSuchElementException e){
}
public class Visitor extends Page{
private String engagementWindow;
@Required
public void setEngagementWindow(String engagementWindow) {
this.engagementWindow = engagementWindow;
}
private String slideOut;
@Required
public class AgentEntryPage extends Page{
private String siteId;
public String getSiteId() {
return siteId;
}
@Required
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public class AgentLoginPage extends Page {
private String loginButton;
public String getLoginButton() {
return loginButton;
}
@Required
public void setLoginButton(String loginButton) {
this.loginButton = loginButton;
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
...
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>QA.properties</value>
<value>Pages/AgentLogin.properties</value>
<value>Pages/AgentEntryPage.properties</value>
<value>Pages/Visitor.properties</value>
</list>
</property>
engagement_window = /html/body/div[2]/div
slide_out = //div[contains(@class,'LPMlabel') and text() = 'Let us assist you']
login_button=loginButton