New answers tagged

0

Selenium doesn't provide any functionality to deal with Excel documents, however assuming you're using Java you can read and write Excel files using Apache POI library Reference code: Workbook wb = new HSSFWorkbook(); CreationHelper createHelper = wb.getCreationHelper(); Sheet sheet = wb.createSheet("Sheet1"); Row row = sheet.createRow(0); Cell cell = ...


0

You can find the ALM REST API reference guide here: http://support.openview.hp.com/selfsolve/manuals http://support.openview.hp.com/selfsolve/document/KM997956/binary/ALM11.00_REST_API.html?searchIdentifier=-765a98c0%3a12de84ca170%3a-27ac&resultType=document These both require logins so I can't provide any other information that the links really. ...


1

@Lyndon, Completely agree. @Rajesh, Its not the area of Selenium. Its open source framework for web-automation and now they have extension of it for mobile platform called as Appium. Not possible using Selenium!


0

Agree to you[user246] and addition to that, Page Object classes, For each page we will create a separate class with constructor A constructor that returns a new instance of the specific page object Constructor takes, task of initializing all the web elements for particular page


0

Solution 1 : I use PageFactory with AjaxElementLocatorFactory - PageFactory is a support class for the Selenium 2 Page Objects pattern which you are using, and the AjaxElementLocatorFactory is the factory for the element locators. In your case the constructor will looks like: public GoogleResultsPage() { PageFactory.initElements(new ...


0

It is very easy to handle excel data using POI as well as JXL jar in selenium.Mostly for jxl jar/POI you have to use Dataprovider in TestNG for easy purpose. You can find more details in this article ,it has given datadriven framework implemention here .Reading data from excel


1

In addition to choose one non-leap year and test against 29th Feb; expected to fail choose one non-leap year and test against 31st April; expected to fail choose one leap year and test against 29th Feb; expected to succeed choose one leap year and test against 31st April; expected to fail I would consider adding more positive tests at day (time), month ...


0

Two reasons for occurrence of Stale element An element that is found on a web page referenced as a WebElement in WebDriver then the DOM changes (probably due to JavaScript functions) that WebElement goes stale. The element has been deleted entirely. When you try to interact with the staled WebElement[any above case], the StaleElementException is thrown. ...


0

Simple way & working solution, When you want to take action on Hidden element First of all we know that element should be visible hidden_element.send_keys "" Once element get visible using selenium we can easily take any action hidden_element.click() I hope code snippet will help you! Try it


0

@Ami - You are doing in far complicated way I guess Why don't you try to fetch all data you need in below fashion? Very simple solution public Object[][] signUpPage1FieldValidationData() throws Exception{ Object[][] retObjArr=getTestData("<your .xls file name","<your tab name>", "<fields which you wanted to fetch>"); ...


0

While I love protractor as any easy functional testing stack for angular-front-end sites I'm not sure I'd point at the tools you're using first. 1) Verify it shows up somewhere on the page and that you can find it with your locator. 2) If it's not on the page immediately, add a wait condition for the element to be visible, etc. in your script. If it's on ...


0

In my mind, if it's angular and selenium, then the solution is protractor. Having said that have a look at [http://www.protractortest.org/#/tutorial] if it helps.


0

This is usually caused due to timing. I think the element is not visible when the code is executed for that element. So wait for a few seconds until the element appears You can try sleep(2000) or Try using Javascript executor JavaScriptExecutor executor = (JavascriptExecutor) driver; executor.executeScript("arguments[0].click()", WebElement);


0

Two reasons for Stale element An element that is found on a web page referenced as a WebElement in WebDriver then the DOM changes (probably due to JavaScript functions) that WebElement goes stale. The element has been deleted entirely. When you try to interact with the staled WebElement[any above case], the StaleElementException is thrown. Solutions to ...


0

What this means is that you are grabbing the element before the page has fully loaded, and the DOM has changed since you grabbed the element. You need to add logic to wait for the page to load or for ajax requests to finish, and then grab the element by the locator and click on it.


0

I use PageFactory with AjaxElementLocatorFactory - PageFactory is a support class for the Selenium 2 Page Objects pattern which you are using, and the AjaxElementLocatorFactory is the factory for the element locators. In your case the constructor will looks like: public GoogleResultsPage() { PageFactory.initElements(new AjaxElementLocatorFactory(driver,...


1

You can access a logged entry from Har object at runtime. For instance, the following code will return only entries (tuples of a request and a response) with HTTP POST request: Har har = proxy.getHar(); List<HarEntry> matchingEntries = har.getLog().getEntries().stream() .filter(e -> e.getRequest().getMethod().equals("POST")) .collect(Collectors....


2

(Disclaimer, I didn't test this. It may not work as is, but hopefully will at least give you an idea about a possible solution) You could try something like: Har har = proxy.getHar(); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { har.writeTo(out); } catch (IOException e) { e.printStackTrace(); } InputStream in = new ...


0

This works for me: Set <String> handles =driver.getWindowHandles(); Iterator<String> it = handles.iterator(); String parent = it.next(); String child = it.next(); driver.switchTo().window(child); //perform actions on child window //perform actions on child window driver.close(); // only for child wondow ...


2

You can ignore javascript errors by changing WebClient options. You just need to extend HtmlUnitDriver class in such way. public class CustomHtmlUnitDriver extends HtmlUnitDriver { ... @Override protected WebClient modifyWebClient(WebClient client) { WebClient modifiedClient = super.modifyWebClient(client); modifiedClient.getOptions()....


0

There's no way to do it with PageFactory without re-implementing it. Locators to page object elements in @FindBy annotations cannot be updated at runtime. You probably would like to have something like fruits("Apple").click(); However, the proxy created by PageFactory for fruits field accessor does not take any arguments. It just does something like: ...


0

Ruby approach I dedicated myself to writing the lightest framework I could for testing an external site using Ruby, RSpec and Capybara. You can see the results at https://github.com/durrantm/basic_app The test file looks like this: $ cat spec/foo_spec.rb require 'rspec' require 'capybara' require 'capybara/rspec' require 'capybara/dsl' Capybara....


2

Selenium can only do what user can do in the browser (that's the whole point). So if user can access logs from the browser (which will have to be a service by that third party), you can do it with selenium. If not, you cannot (so your logs are safe from any lurker).


0

I have applied below solution steps - Remove Proxy Ensure your computer is not using any proxies, connect to open network Open terminal and hit below commands: rm -rf ~/.m2/repository/antlr rm -rf ~/.m2/repository/aopalliance rm -rf ~/.m2/repository/asm Remove/delete that particular dependent .JAR from library folder From terminal navigate to your ...


3

The simplest way to start test automation project from another one would be to sent command line command: Process process = Runtime.getRuntime().exec("java org.testng.TestNG C:\path-to\testng.xml"); or call some parametrized .bat file so not to write lots of dependencies in java code. E.g.: Process process = Runtime.getRuntime().exec("run-suite.bat C:\...


1

Eclipse does a lot of voodoo behind the scenes to make sure everything is plugged together in a really big an robust way. Good for your development environment, but way overkill for production. Java only knows to look in very specific places for bytecode to load into it's runtime. If you want runtime flexibility to load classes within your gui from ...


0

Your element is not visible. Thats the reason Selenium couldn't able to click on it. Are you sure the element is visible? According to Selenium an element is visible if: visibility != hidden display != none (is also checked against every parent element) opacity != 0 (this is not checked for clicking an element) height and width are both > 0 for an input, ...


0

This is common problem, usually solved by object-relation mapper (ORM) helper library. There are many for Java (too many), so it is not easy to choose a good one. :-) Do your research before you commit to one of them.


0

Since this is more of a "what works best for you answer" I will provide a solution on how our team handled something like this in our testing framework. (Feel free to disregard if it doesn't work for you) We decided that we wanted to use a list of dictionaries to hold our SQL data. This way we could pull as many columns as we wanted, and have as many rows ...


0

There are a huge number of tools, languages and frameworks that can help you do this. There is really no 'best' path as each component will depend on your situation. My personal recommendation is to consider the Ruby path. However this is just part of a larger picture for which could be somewhat like the following steps: Learning test automation basics ...


0

You can start learning by following lessons of this course. You dont need to buy it, you just need to get the title of each lesson and google about it.


0

These days, Automated software testing is considered as one of the most trending term in the field of software testing, as it is considered as one of the efficient as well as effective software methodology, making the overall software development/testing life cycle better and taking it to some different level. To learn Automation testing, there are few good ...


0

A new window is basically a new webpage that opens in a separate window or a tab depending on your browser settings. Since you have asked for examples, here it is e.g. visit appium tutorial webpage. Click on any chapter say chapter 1. It will take you to new window/tab. An alert box or pop up window is often used if you want to make sure information ...


0

You have to do some string manipulations to get the desired result String text=driver.findElement(By.id(idOfRecordCountElement)).getText(); String desiredText=text.substring(0,text.indexOf("\n"));


-1

executor.swipeWhileNotFound(direction, offset, element);


0

client.elementSwipeWhileNotFound("NATIVE", "id=nav_drawer", "Down", 0, 2000, "NATIVE", "text=History", 0, 1000, 5, true)) or normal scroll method available to use- client.scroll(500,500);



Top 50 recent answers are included