Tag Info

New answers tagged

0

Although i do not have much idea about it but i think you can give selenium grid a try. I read on seleniumhq.org that with selenium grid you can create a master slave architecture, where one master machine will control several slaves to send request to a common server. Maybe this can help solve your issue!


0

The screenshots you posted earlier make it look like you're not importing in the correct frameworks. I'd suggest you read up on Java's import statement, and maybe go through a basic Java tutorial before you begin again.


0

The Keys points to consider while choosing an automation approach (Data Driven/Keyword based /Hybrid/) are as follows - Is the Application under Test - Data intensive ? - Better of with Data Driven approach then. Is the application more about functional tests (e.g. workflows) - Better to go with a keyword approach - specially if those functional tests ...


1

I can see several problems in your code. Paramaterized @BeforeSuite method with no data provider. Your @BeforeSuite method (main()) takes a parameter (args), but you have not told TestNG how to provide a value for that. That's what that exception message means. Calling test methods. When you run under TestNG, your @BeforeSuite method calls your test ...


0

Gestures - User can perform multiple clicks on submit button / search button occasionally which could result in page reloads / transactions cancelled Image / Video Previews - Between transitioning between thumbnail and playback of videos I have observed not well automated Payment gateway timeouts - During peak transactions there could be timeouts with ...


1

As I know captcha (Some captcha you can test) you can not test using selenium webdriver.


3

You mean to say in one class multiple methods you want to run, then use below code and try. @BeforeTest public static void beforeMethod() { driver= new FirefoxDriver(); } @Test public void main1() { driver.get("http://indianrail.gov.in/pnr_Enq.html"); driver.findElement(By.id("element")).sendKeys("1234567890"); String ...


0

The same issue occurs when you didn't configure IE properly according to manual: InternetExplorer configuration Make sure: Zoom is set to 100% Protected Mode settings for each zone have the same value


1

This is how I implemented a quick utility function to switch to a window based on the title: public static void switchToWindowWithTitle(String title, WebDriver driver) { Set<String> windowHandles = driver.getWindowHandles(); for(String handle : windowHandles){ driver.switchTo().window(handle); if ...


0

The answer to this depends on what level of coding do you wish to do? How complex will your test script be? To begin with you might want to learn basic/core java and then keep on improving with practice and seeking help from others to put together complex scripts to test complex software.


1

I found this really simple code to write output to file. You can find it here - http://www.mkyong.com/java/how-to-write-to-file-in-java-bufferedwriter-example/ You can customize the code to fit your need and write the list values to file by placing the bw.write() part withing a loop.


0

You could use driver.findElement(By.xpath(".//*[@id='ctl04_Pane2_AttributeDefinitionCategoryTest']/td[2]/div/select")).sendKeys(Keys.RETURN); for an easy fix. However there are ways to select by the value. Select select = new Select(driver.findElement(By.xpath(".//*[@id='ctl04_Pane2_AttributeDefinitionCategoryTest']/td[2]/div/select"))); ...


0

use driver.switchto().activeelement() before sending the arrow keys.


1

Hello since you are getting the results in the List, you can export them to a file for use in future, or can use them further for comparison or whatever you need since the data is already stored in the List variable. You can see in this sample code here - http://milinpatel17.wordpress.com/2014/07/02/web-page-link-test-using-selenium-webdriver/ that I have ...


0

I think the easiest way to do this would be to manipulate the javascript on the page to get the two strings you need. First go to that primary shopping page and have the browser click the quick view this will load and give you a way to select the text use document.querySelector('h1 > a').textContent; and you should get something like "Roadster Men White ...


0

Something like this might help: public static Object scrollElementIntoView(WebDriver driver, WebElement element) { return ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); } Where element is the object to which we want to scroll to.


1

You are comparing values, so better you store each values in the String and compare both the String values.


1

Please use below code. driver.get("http://www.flipkart.com/"); driver.manage().window().maximize(); driver.findElement(By.linkText("Trimmer")).click(); WebElement scroll = driver.findElement(By.id("brand")); scroll.sendKeys(Keys.PAGE_DOWN);


1

What this does is, it waits until the element with id "foo" is found. If the element is not found, retry every 5 seconds. But wait only up to a maximum of 30 seconds. It does this by calling the following function every 5 seconds, until it doesn't return null: public WebElement apply(WebDriver driver) { return driver.findElement(By.id("foo")); } The ...


0

Learn the basics of JAVA(any programming language) - Door step to Selenium2 automation Assuming you have a basic understanding of HTML, CSS Learn about locators, simple selenium commands and try to automate simple functionality Once you got to know how to control the browser, you can go on using the frameworks like TestNG(preferrable) or JUnit Learn ...


0

WebDriver driver; //instantiated somewhere else, obviously WebElement element = driver.findElement(By.xpath("//div[@class='btnContr']/input[@value='Cancel']"); element.click(); Why are you bothering with JavascriptExecutor, when Selenium has the functionality to click an element selected by XPath built in?


0

Generally, it is bad practice to set the WebDriver instance as static. You should create a base class that each of your test classes extend so that each test class has its own instance of WebDriver to be used (this is especially important with parallel execution), then just declare/define your WebDriver variable within that base class.


6

Java My experience is, that the basics of Java suffice to start developing test cases with Selenium 2 / WebDriver. Myself started developing of Selenium test cases with a basic knowledge about Java. The more test cases I wrote and solutions I had to find, the more I leaned about the programming language. Unit Testing Framework (JUnit, TestNG) Write some ...



Top 50 recent answers are included