6 votes

Why this "WebDriver driver = new ChromeDriver();" Not this "ChromeDriver driver= new ChromeDriver();"

We generally do it this way because usually we want to be able to run our tests on multiple browsers. If we declare the driver as a specific driver type, we are then anchored to only that driver. ...
user avatar
6 votes

Using Python Selenium Not able to perform click operation

Try using JavaScriptExecutor C# IWebElement element = driver.FindElement(By.XPath("//button[@role='button']")); IJavaScriptExecutor jse2 = (IJavaScriptExecutor)driver; jse2.ExecuteScript("arguments[...
user avatar
5 votes
Accepted

What is geckodriver? How to use it in Selenium Webdriver?

GeckoDriver: A Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers. Geckodriver provides HTTP API described by the WebDriver protocol to communicate with Gecko ...
user avatar
  • 6,749
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>...
user avatar
4 votes

Why this "WebDriver driver = new ChromeDriver();" Not this "ChromeDriver driver= new ChromeDriver();"

Absolutely right, Good explanation provided by @Bill Hileman, I was already upvoted it. In addition to clear this doubt you need to understand What is WebDriver and ChromeDriver/Firefoxdriver. ...
user avatar
  • 6,749
4 votes
Accepted

Geckodriver: How to use "moz:firefoxOptions" on node.config for selenium grid

Unfortunatelly I found only workaround solution (e.g. if you need several different Firefox versions on a single station): nodeConfig_1.json { "capabilities": [ { "browserName": "firefox"...
user avatar
4 votes
Accepted

How to parameterize @findBy in pageFactory

Unfortunately, it's not possible to send arguments to annotation (reference) One possible solution would be to create a Page Object class for link and pass a WebElement based on its li node. Class ...
user avatar
  • 9,786
3 votes

Find first IMG element using XPATH

This will get you the first result's img element: (//a[@class='_1UoZlX']//img)[1] Honestly though, this is a rat's nest from hell. If I were you I'd have a serious discussion with the developers ...
user avatar
3 votes
Accepted

Selenium 3.0: Getting exception every time while launching firefox in remotewebdriver

Coming to your first question- How to resolve exception while launching firefox in remotewebdriver: First thing what I observed that- You have to change your code in Setup; as you are using ...
user avatar
  • 6,749
3 votes

geckodriver with Selenium 3.0 driver.get() dosnt navigate to the URL

Selenium recently launched its one of the major release, i.e., Selenium 3 – beta. You can download it from here- Download Selenium 3.0-Beta . In this new version, one of the major change is the way ...
user avatar
  • 6,749
3 votes
Accepted

Updates in Selenium 3 over Selenium 2

Good question, everyone should aware of the new updates and features in Selenium 3. As of my experience Selenium 3 has lots changes made in configuration/setup level. Even though we have to use ...
user avatar
  • 367
3 votes

How to Handle successful submission of a form in Selenium?

There are no ways to check if you have logged in successfully other than the real users would use. If you log in successfully then you should see some elements that the guest would not see (e.g. the ...
user avatar
  • 11.4k
3 votes

Selenium Webdriver TestNG (Java) using While loop for all tests

You shouldn't use while loops to provide test data to your tests if you use some dedicated test frameworks like TestNg. Instead you should use the mechanisms provided by such frameworks. For TestNg ...
user avatar
  • 11.4k
3 votes

How to fetch username and password from excel one by one to test login functionality in robot framework-selenium-python

I am not sure what the code you have there do as it is incomplete. So assuming that you want to do data driven testing, use RobotFramework-datadriver: Structure of data file. Installation: pip install ...
user avatar
  • 10.8k
2 votes
Accepted

GeckoDriver error in TestNG that works in plain JAVA

The syntax for setProperty() method is: System.setProperty("<driver we want to use in the program>", "<path where the driver exists>"); As per the question, In java ...
user avatar
  • 714
2 votes

Is there a way to use Selenium 3 to automate testing in Safari 11 without the 'glass pane'?

The short answer is no. The longer answer is I'm not 100% sure but I'm fairly confident the answer is no. I've worked at Sauce Labs for a few years now, several of them in support. I've done a lot of ...
user avatar
2 votes

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

Different scenarios: 1) maxlength attribute In HTML you might have a maxlength attribute on your input tag. In this case you can extract the value with Selenium's GetAttribute("maxlength") or ...
user avatar
  • 5,824
2 votes
Accepted

How to reliably maintain a desktop session while running selenium node on windows VM?

The most reliable method I've found is to configure the VMs to auto-logon with an administrator-level login and disable screensaver and user access control. This effectively means that whenever the vm ...
user avatar
  • 30.6k
2 votes

Getting different results using selenium and iFrames on Firefox 63, Chrome 69 and Chrome 70

Have you updated chrome driver as well? – Alexey R. Oct 30 '18 at 16:13 Resolved ! Upgrading to Chromedriver 2.43 did the trick. Latest Release: ChromeDriver 2.43 Supports Chrome v69-71 Changes ...
user avatar
2 votes

To use direct page URL or complete path?

Like a lot of things in life, it depends. Both options you lay out will work for test automation. However, what is your overall goal? Are you testing a feature that is on one page? If so, you can ...
user avatar
  • 1,492
2 votes
Accepted

How can I handle the chrome HTTP Authentication popup window in selenium without AutoIT?

Authentication via the URL has been deprecated for a while: While this may sound like a thunder from clear skies for Chrome users, it is not. The deprecation “order” comes from RFC 3986: ... 3.2.1. ...
user avatar
2 votes

How can I handle the chrome HTTP Authentication popup window in selenium without AutoIT?

Despite you have chosen Niels answer as correct, I would also suggest a way to work around your issue. What you're talking about is likely a "basic authentication". The best way to bypass ...
user avatar
  • 11.4k
2 votes

What is the purpose of creating a BaseTest class which declares a global static WebDriver object in POM framework?

In your code, I think you have mixed two approaches together. Using Base Class Without Using Base Class In Approach 1: You don't have to assign a driver to a local variable if you are using a base ...
user avatar
  • 10.8k
2 votes
Accepted

How to click pop up window button in selenium with Pyhton

use xpath or css css : [class="message-component message-button no-children pg-accept-button"] driver.find_elements_by_css_selector('[class="message-component message-button no-...
user avatar
  • 10.8k
2 votes

Checkbox gets unchecked even though the Code is written to only select the checkbox..can someone pls help

The approach you are using works only with native check-boxes (i.e. <input type="checkbox"/>). What you have is a custom element that looks like a check-box and behaves like a check-...
user avatar
  • 11.4k
1 vote

Confused between WebDriverWait and FluentWait

FluentWait: According to your code snippet, it will wait for the expected web element upto 30 seconds. And it will check the condition (or in simple words, look for the element) every 5 seconds within ...
user avatar
  • 624
1 vote
Accepted

Adding a stickynote on site using toolbar

This appears to be an issue with the driver losing track of the click on the note as soon as the click on the image occurs. This is pretty common with some types of dropdowns, but applies in other ...
user avatar
1 vote

Find first IMG element using XPATH

I would just let Selenium find the first img element - no need to do it via XPath manually: IWebElement firstImage = driver.FindElement(By.TagName("img")); Or, if you want to do it in the scope of ...
user avatar
  • 11.4k
1 vote

What is geckodriver? How to use it in Selenium Webdriver?

Lot of article are present on internet regarding GeckoDriver and Selenium 3. Gecko is a webbrowser-engine used in many applications developed by Mozilla Foundation and the Mozilla Corporation Gecko ...
user avatar
1 vote

What is geckodriver? How to use it in Selenium Webdriver?

I'm not sure if you had googled it before you post your question here. Anyway, first you need to know what Gecko is. Gecko is a web browser engine used in many applications developed by Mozilla ...
user avatar

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