11 votes

Running WebDriver without opening actual browser window

You used to be able to use PhantomJS for this, but since PhantomJS itself is discontinued, so is the Selenium PhantomJS driver. The good news is, that you can simply use Chrome. Chrome itself has ...
realbart's user avatar
  • 211
11 votes

What do I need to do if dropdown takes more time to populate 1st element from dropdown list?

Do you think that time is the problem here? If so try to increase the time you are providing in Thread.sleep(); and see it that works out for you. If its not the time, then did you try to find out ...
Lucy Jac's user avatar
  • 129
11 votes

Unable to scroll down to bottom of div with data loading dynamically

Check below are the various methods to scroll your web page up & down: Scroll Down: import org.openqa.selenium.JavascriptExecutor; WebDriver driver = new FirefoxDriver(); JavascriptExecutor jse =...
Bharat Mane's user avatar
  • 6,785
10 votes

What are some tools for testing Mobile web apps?

There are a number of tools available for testing mobile apps: a) Robotium b) Uiautomator c) Espresso d) Appium e) Calabash But my experience -I can suggest you Appium is the best tool for both ...
7 votes

How do you block Google Analytics from Selenium automated visits?

It's not very well documented, but you can also implement request blocking by passing the host-resolver-rules option to chrome and mapping the domain to localhost or an invalid IP. Something like this ...
David Lumpkin's user avatar
7 votes

How to Implement Page Object and Page Factory Pattern in Selenium Webdriver?

Page Factory Pattern is like an extension to Page Object Model , but Page Factory is much enhanced model. To start with, we just need to import package org.openqa.selenium.support.PageFactory "...
Bharat Mane's user avatar
  • 6,785
7 votes

How to verify two images using Selenium WebDriver?

Selenium is a software library to locate elements on web page and interact with them. To deal with images, you need to use different library. Selenium can provide screenshots (images) but you need to ...
Peter M. - stands for Monica's user avatar
6 votes

How to download a file using Selenium's WebDriver?

I made my own version of the downloader, by using an Ajax request and returning the bytes. Has the advantage that it uses the browser directly, so authentication and cookies do not need to be dealt ...
gimix's user avatar
  • 161
6 votes
Accepted

How to take ScreenShot & save it with different filenames by using Selenium & Java?

Two options: Generate a unique filename for each save, by appending a timestamp or a GUID. Also, see this question. public void screenShot() throws IOException, InterruptedException { File scr = ...
Niels van Reijmersdal's user avatar
6 votes
Accepted

What is the hierarchy to use for finding elements - ID, class, name, xpath?

My main criteria is readability and maintainability. Speed has never been as issue for me. There's other parts of the test frameworks I use that have much more significant speed issues. The basic ...
Michael Durrant's user avatar
6 votes

What are the things that one must consider while learning Selenium Webdriver Automation framework?

This is going to be blunt. I don't know a not-blunt way to say this. First, learn to code. Working with Selenium, no matter what your toolkit happens to be, is writing code. If you don't understand ...
Kate Paulk's user avatar
  • 31.5k
5 votes

What are some tools for testing Mobile web apps?

Top tools for testing mobile apps: Appium: Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms. Appium is "cross-platform": it allows ...
5 votes

How to handle "Time out receiving message from the renderer" in chrome driver?

I am not saying this is the solution but I want to share my experience after investigating a day on this. The problem with our site was actually because of the time it took for a third party to load a ...
Hemanand Rajamani's user avatar
5 votes

Can I use Selenium to do Desktop Application testing?

Selenium does not have the capability to automate the desktop applications.It cannot recognize the objects in a desktop application. Selenium drives the testing using the driver object that identifies ...
Jay's user avatar
  • 51
5 votes

Unable to enter the text in a text box

You may try with javascriptexecutor- Check below code- driver.switchTo().frame("WallItemItemDetail_ifr"); // select the editor and do the input WebElement TextBox = driver.findElement(By....
Bharat Mane's user avatar
  • 6,785
5 votes
Accepted

Are there any non-selenium based tools for Automation testing?

I find MITM proxies and Mocks/Stubbing to be the most advanced pieces of Technology in Automated Checking. By using these, it makes it far easier to: Create repeatable, consistent checks Decrease ...
Paul Muir's user avatar
  • 3,282
5 votes

How to verify two images using Selenium WebDriver?

Use Sikulix API. Sikuli is a library that will help you compare two images or recognize images when they are displayed on your screen. After the said image is displayed, you can click on the ...
LittlePanda's user avatar
5 votes
Accepted

Not able to find the element to click | Selenium Webdriver | Add New User Issue | Getting java.lang.nullpointerexception

Welcome to SQA. Instead of me investigating what happens in this particular case, I think it will be more helpful for this and similar questions to understand how to read stacktrace see an actual ...
dzieciou's user avatar
  • 10.5k
5 votes
Accepted

how do perform menu list selection in web application using selenium?

You can use the Actions API for that, given that the browser you use supports it. The following should do the trick with Chrome: Moves the mouse over the "Admin" button Waits until the "User ...
ralph.mayr's user avatar
5 votes

How to handle web element(enable button) having same Xpath?

In my case, How I worked on this same scenario: Suppose if you have 3 buttons with the same XPath-like in my DOM: <input type="submit" id="button" value="Edit"/> <input type="submit" id="...
Bharat Mane's user avatar
  • 6,785
5 votes

How to get max character count for input fields with selenium webdriver

You can find the field and get the maxlength attribute max_length=find('input#id').getAttribute('maxlength') In the IDE I think it would be something like this to store it in 'x': <td>...
Michael Durrant's user avatar
4 votes

How to handle "Time out receiving message from the renderer" in chrome driver?

So I've solved this, but my solution is an awful hack. The only thing it has going for it is that it has worked, at least for us. Here's the code: Here's the code at the center of the solution: ...
Akien MacIain's user avatar
4 votes
Accepted

Unable to select text from dropdown - Gmail.com Month Dropdown

WebElement monthDropdown = driver.findElement(By.xpath("//div[@class='goog-inline-block goog-flat-menu-button jfk-select goog-flat-menu-button-focused goog-flat-menu-button-hover']")); // Select ...
Bharat Mane's user avatar
  • 6,785
4 votes

Are there any non-selenium based tools for Automation testing?

The most recent developments that I have observed are: Running tests in the cloud. Companies like Sauce Labs and Browserstack are leaders here. There are many advantages to this, from the number of ...
Michael Durrant's user avatar
4 votes
Accepted

Firefox does not shows saved bookmarks, addons while launching?

IIRC selenium webdriver creates a fresh FF profile each time it's constructed. I found a link about how to set it to a different profile (one where your bookmarks, addons etc. exist) Regarding IE, I ...
user3557137's user avatar
4 votes

Firefox does not shows saved bookmarks, addons while launching?

Yes absolutely right. Because all those bookmarks, addons, passwords etc.. are saved In your regular browser's profile folder so when you launch browser manually, It will use existing profile ...
Bharat Mane's user avatar
  • 6,785
4 votes
Accepted

What is the procedure to start Safari browser?

Launching Safari browser is very easy, just you have to add safariDriver jar in your Windows Safari browser. Check after installation whether this icon is displayed or not? If Yes then it will work....
Bharat Mane's user avatar
  • 6,785
4 votes

Which Programming Language is more supportive to start with Selenium?

Selenium supports various programming languages like Java, Perl, Python, Ruby, C#(.Net) etc. So it's mainly up to you. You should choose the language itself, and not the bindings. If you were to ...
Bharat Mane's user avatar
  • 6,785
4 votes

How to locate XPath for given tag?

You may use this- Xpath1= //a[contains(.,'Create a Rediffmail account')] OR Xpath2=//a[contains(@href,'details')] OR Xpath3=.//*[@id='toprightinfo']/a[2] Or you try with other Locator ...
Bharat Mane's user avatar
  • 6,785
4 votes

How to select li element in selenium

Use the below code: WebElement countryUL= driver.findElement(By.xpath("//[@id='country_id']/ul")); List<WebElement> countriesList=countryUL.findElements(By.tagName("li")); for (WebElement li : ...
Nikunj Aggarwal's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible