New answers tagged

0

The latest development version of PhantomJS (2.2.0-development) contains a fix for this problem. Since PhantomJS releases are oncea year and I couldn't wait that much time I downloaded their sources and compiled them (they do not provide daily builds, aka snapshots).


0

I reccomend after SendKeys to fire an event fireEvent(locator, blur). From documentation: fireEvent(locator, eventName) Arguments: locator - an element locator eventName - the event name, e.g. "focus" or "blur" Explicitly simulate an event, to trigger the **corresponding "onevent" handler**. SendKeys does not do the same thing as your keyboard ...


-1

"At a guess, your page has JavaScript code to search dynamically on any keypress, and SendKeys does not trigger the event that triggers the search. You're going to need to find the JavaScript code that populates your dropdown menu, then work out how to force Selenium to trigger that specific event." – Kate Paulk 17 hours ago This worked, i got event to ...


0

Instead if using WebDriver use the EventFiringWebDriver and sendkeys will work without any issue and fire the text change event as well.


0

I think you need to inspect to know which event fire when typing on the textbox, try to fire that event using JS or JQuery, then force Selenium execute script.


0

Autoupdate happens AFTER you finish typing, right? I think you need to end the string with TAB ("\t") to leave the input field, so all related events can fire.


0

Possibly answered here. Not sure if this should be flagged as a duplicate or not.


3

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 "Factory class can be used to make using Page Objects simpler and easier". We use Page Factory pattern to initialize web elements which are defined in Page Objects. ...


0

In very simple terms, the explanation for page objects is as follows: A separate class (per page) which lists all the objects in a page and the allowed operations that can be performed by them can be created. And whenever you need to perform any tests on that particular page in your webapp, you write the test to first import the page, and thereafter, perform ...


0

Open Mozilla FireFox. Install Firebug add-on. Install FirePath add-on. Browse your webpage in FireFox. Hit F12. Click FirePath tab. Inspect the element for which you want to get the Xpath. Copy the xpath from the FirePath console. It's really this simple!!!


3

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 types as- LinkText Check I have tried & found 1 match xpath-


4

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 force me to name the language you should use- JAVA. I would have to give you the famous then- Java is a my first choice to start with Selenium(even if it is a bit ...


1

Selenium has bindings for the most common languages (see http://www.seleniumhq.org/download/) so use the one either you know best, and/or the one your development team uses for easier integration in the development cycle and common use of tools.


0

As a matter of fact for drop down list, in Selenium we have Select class. To use this select class you have to use import statement- import org.openqa.selenium.support.ui.Select This Select class has several methods that are supported to access the elements. ByVisibleText ByIndex By.Id ByValue Sample code: Select dropDown1 = new Select(element1); ...


2

There is another tool to record page object model. below is the link: http://seleniumrecorder.blogspot.com/


0

Angular uses IDs heavily for interaction and DOM manipulation. As a result, WebDriver tests cannot rely on IDs to locate elements, and locating by name is bit more hassle (non-unique etc). But you can still write tests using WebDriver (that's how Protractor does it after all, under the skin). WebDriver tests are Angular-agnostic, they know nothing about ...


1

Find the common denominator to find the elements for the product by (preferably including the Add to Cart button) and then iterate over the Array/List/Enumerable and verify that it contains the Add to Cart button.


0

My guess will be that the creators of Protractor (which is the same team as AngularJS) just didn't want to switch languages for E2E testing, so they made effort to bring Selenium WebDriver to NodeJS.


0

Uploading files using Webdriver (Locally) I present below two ways to upload a file. The first uses Python Selenium in a special case (invisible input), the second handles a Windows Dialog Box. Invisible input If the input is hidden, make it visible. Here is an example (Python). The input is hidden at the bottom of the page and looks like this: ...


0

You should use xpath. If your text 'IPS' is the text inside tag use this: //*[contains(.,'IPS')]. If 'IPS' is for example part of @class atrribute use this: //*[contains(@class,'IPS')]. If 'IPS' is always at the begginig of the text you can use starts-with command instead of contains. Unfortunately web browsers dont support Xpath 2.0 which provides ...


0

Use contains() or starts-with() function in xpah : Solution : With contains : //*[contains(@id,'IPS')] With starts-with : //*[starts-with(@id,'IPS')] Where * means any element. Let me know If any query.


1

WebElement element=driver.findElement(By.xpath("(//div[@class='selectItemText'])[2]")); Thread.sleep(5000); element.click(); Thread.sleep(10000); driver.findElement(By.xpath("(//nobr[text( )='MDialog'])[4]")).click(); //driver.findElement(By.xpath("//nobr[text()='MDialog']")).click(); ...


0

First of all Select is not working with Div or any other element. Select are use only with element is having Select tag and inside it, only having option tags. Solution : WebElement element=driver.findElement(By.xpath("//div[contains(@id,'isc_FX')]")); element.click(); driver.findElement(By.xpath("//*[text()='MDialog']")).click(); Try this. ...



Top 50 recent answers are included