Category Archives: Selenium

When to use Selenium IDE(Recording) ?

• To check whether the application is compatible or not can be identified by using selenium IDE.
Ex:- Record few scenarios and check that whether the tool is generating the script or not.
• If it is generating the scripts then we can conclude that the application is compatible with selenium..
• If you are facing any problem to identify the locator/target then it can be overcome by using selenium IDE.(We can take the locator from Selenium IDE)
Continue reading When to use Selenium IDE(Recording) ?

What is selenium IDE ?

• IDE stands for Integrated Development Environment
• It is to record and run the script.
• It is an add-on for Firefox (we can install and record in Firefox browser only).
• It is accountable for user actions (for each and every action it will generate the script).
• By default it will generate the script in html language. If required we can convert to other supported language like java, .net etc.
• The recorded scripts can be run against other browsers also with the help of RC or web driver.

What is automation strategy/ approach/ automation life cycle to automate one project ?

• Check that whether the application is compatible or not with the tools (Selenium).
• Develop POC(Proof of concept) – Automate 2 to 3 scenarios and present it to the client
• Execute or review all the test cases at least once to get the functional knowledge on the application and also to identify the test cases which are feasible for automation.
Continue reading What is automation strategy/ approach/ automation life cycle to automate one project ?

How to create Default Selenium object and what parameters needs to be pass ?

DefaultSelenium selenium = new DefaultSelenium(“localhost”,4444,”*firefox”,”http://”);

localhost – It is the machine name and selenium server should be configured in the specific machine
4444 – It’s selenium port number.
*firefox – Its is the command to launch firefox
http:// – Protocol to open URL

How to take data from excel file in Testing

FileInputStream fileInput = new FileInputStream(“Path of the excel file”);
Workbook workBook = Workbook.getWorkbook(fileInput );
Sheet sheet = workBook.getSheet(0);

It will read the excel file upto the sheet.
To take the data from sheet, use below command

sheet.getCell(columnID, rowID).getContents());

eg: sheet.getCell(0, 1).getContents();

Did you implement any framework In Testing?

Yes we have implemented data driven framework.
• From data driven onwards external files like excel text (notepad),database, xml etc.
• The external files are to take test data and to give the output results.
• It contains driver script which is responsible for executes. The driver script doesn’t contain any of the test cases and test data.
Continue reading Did you implement any framework In Testing?

How to Scroll down and Scroll up in the Browser.

WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(“http://spicejet.com”);
Actions action = new Actions(driver);
action.KeyDown(Keys.CONTROL).sendKeys(Keys.END).build().perform();
Thread.sleep(1000);
action.keyDown(Keys.CONTROL).sendKeys(Keys.HOME).build().perform();
action.Keydown(Key.ALT).sendKeys(Keys.F1).build().perform();

How to Mouse over on one Element by using Webdriver.

WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(“http://spicejet.com”);
Actions action =  new Actions(driver);
webElement str = driver.findElement(By.linkText(“AboutUs”));
action.moveToElement(str).build().perform();

What is the difference between Single and Double slash in Xpath.

“// ” is the starting point of the Xpath.
“/” will navigate into the tag

Eg. //html/head/body/div1/div2/……

How to capture Screenshot in web driver.

We can capture screenshot by using below two lines:

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(“D:\\screenshot.png”));