My Blog List

Thursday, February 23, 2012

WebDriver - Rare Tips I

1. MouseHover using WebDriver
actions.MoveToElement(element).Click().Build().Perform();

2. ChromeDriver Usage
Don't forget to include the ChromeDriver.exe before executing webdriver script.
  1. System.setProperty("webdriver.chrome.driver", "c:\\selenium_downloads\\google_driver\\chromedriver.exe");
  2. WebDriver driver = new ChromeDriver();
  3. driver.get("http://www.google.com");
You can look more info from here.
https://code.google.com/p/selenium/wiki/ChromeDriver


3. Set to trust all SecurityCertificates
  1. RemoteControlConfiguration rcc = new RemoteControlConfiguration ();
  2. rcc.setTrustAllSSLCertificates(true);
  3. SeleniumServer seleniumserver=new SeleniumServer(rcc);
  4. seleniumserver.boot();
  5. seleniumserver.start();
  6. setUp("https://www.google.com/", "*firefox");
  7. selenium.open("/");


Also you can avoid SSL problems using firefox profiles.
1. When you start Selenium RC Server, you can ask it to use a particular Firefox Profile as following:
  1. java -jar selenium-server2.jar -firefoxProfileTemplate "C:\Users\XXXXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\ab815bdy.Selenium"

FF allows to Trust certain website, and never prompt you again. So, you create this profile first, then ask Selenium to use this FF Profile.

1 comment:

  1. Thank you for sharing the information.It is very interesting blog on Selenium

    ReplyDelete