Search This Blog

Showing posts with label Selenium. Show all posts
Showing posts with label Selenium. Show all posts

Saturday, March 29, 2014

How to send text to webelement using javascript


Sometimes with webdriver its not possible to type text in a textbox like password,extjs textbox fields. At that time try below script to send text to textbox. It works.

WebDriver driver = new FirefoxDriver();

((JavascriptExecutor)driver).executeScript("arguments[0].value='test'", driver.findElement(By.xpath(xpath)));

Thursday, February 16, 2012

Wednesday, November 9, 2011

Handling alert, prompt and confirmation box using Selenium RC

This article explain about how to deal with java script alert, prompt and confirmation box.

Copy below html code and save it as test.html.

<html>
<head>
<script type="text/javascript">

How to shutdown selenium server?

Sunday, October 30, 2011

Dealing with SSL certificate error or Https using Selenium RC

As all understand about need of SSL or Https for web applications, not stressing on concept of SSL. Basically need of SSL is to securely transmit sensitive data over the web. 


With out valid SSL certificate browsers prompted users with certificate error page as browser not trusted this site and certificate is not valid. And this is common when comes to automation also. 

Friday, October 28, 2011

Selenium RC getEval tutorial and examples.

Using selenium getEval we can achieve many tasks which are not possible to achieve normally. To achieve this  Selenium RC provided with getEval function.

Syntax:

getEval("javascript code as string"); It returns result of Java script.

Let's have simple example first, below example written using Junit but you can convert getEval script it to your preferred language as it is.


Thursday, October 27, 2011

Identify Iframe and dealing problems with IFRAME using Selenium RC


When you choose Selenium RC for web automation one need to actually evaluate to ensure whether Selenium fit to your application technology or not. Based on need one can eitehr incldue AJAX, IFRAME, Flash etc for better user interface. Adding such technolgies cause hurdles for automation engineers. Though there are many built in functions to support for Selenium RC. But for some issues we need tweak selenium RC to overcome such problems.

Tuesday, February 22, 2011

Handling File upload using selenium.

Here I would like to share my experience on handling file upload using selenium.

To handle file upload using selenium RC (1.0 or higher) comes with two challenges.

1. Clicking on Browse/Upload button.
2. Selecting a file from windows dialog.

I will share handling this on both Fire fox and IE.