Tag Info

Hot answers tagged

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 ...


6

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);


4

Try this line of code: Driver.findElement(By.xpath("enter your xpath")).click(); Hope it works out!


4

I've tested using format http://user:pass@host and it works. So in Python (in setUp() of MyClass(unittest.TestCase) class) this should look like: self.base_url = "http://user:pass@host" In Java based on #34 at code.google, the following code should work as well: public void login(String username, String password){ WebDriver driver = getDriver(); ...


4

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 ...


4

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!


3

List cheeses = driver.findElements(By.className("cheese")); findElements() does not wait, but returns list of elements (located by locator). List is empty if nothing is found. http://docs.seleniumhq.org/docs/03_webdriver.jsp


3

Quickly glanced over the properties and methods of IWebElement, doesn't look like they can set values. However, you can easily execute some javascript snippet to change HTML in your page. IWebDriver driver; IJavaScriptExecutor js = driver as IJavaScriptExecutor; js.ExecuteScript("document.getElementById("title").innerHTML = "New text!";"); You might need ...


3

You can use WebDriverWait to synch with page load. Something like the following might help WebDriverWait wait = new WebDriverWait(driver, 15); //you can play with the time integer to wait for longer than 15 seconds.` wait.until(ExpectedConditions.titleContains("title")); //if you want to wait for a particular title to show up OR ...


3

Try this Driver.SwitchTo().frame("Fancybox-frame"); Driver.findElement("enter your xpath to close popup").click(); Driver.SwitchTo().defaultContent();


3

Selenium is a tool to drive and verify behavior of web-applications, it should not matter where they are hosted. If you can reach the webserver running the application it can be local or hosted in the cloud, the application should behave the same. If you want to test if the cloud setup can handle a certain load and find its bottlenecks I would look at a ...


3

This error means that you have forgotten to include a dependency in your project. It's been suggested on stackoverflow that the dependency you forgot might well be selenium-server-standalone-version.jar. Does adding that jar to your project help?


3

Some good Selenium tutorial for beginner/Intermediate/Advance are given below : 1 - ToolsQA 2 - Guru99


2

you can pass the driver as argument to the methods , so no need to re create them.


2

Create a string variable and use it (for example) as follows: string strMyXPath = "//*[@id='" + recordId + "_ACTION_COLUMN']/a[2]/span"; driver.FindElement(By.XPath(strMyXPath)).Click();


2

I have written a blog on how to take screen shots while using webdriver APIs, This is a basic code but it will help you in taking screenshots. http://apttest.in/how-to-capture-screenshot-in-webdriver-using-java/ package screenshot_package; import java.io.File; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import ...


2

Hey there's two issues here: A) you're calling ToString on an IWebElement. Try calling vele.Text instead of vele.ToString() instead. This will get you the text of the element rather than a taxi representation of the IWebElement. B) you're using an xpath selector, but you're telling Webdriver that you want to use css selector to locate the element. You can ...


2

Why use XPath in your CSS selector? Just try this (assuming your selector is correct for the page you want to test). WebElement vele = driver.findElement(By.cssSelector("#Result h2")); You need to get the text of the WebElement. What you're doing is converting the webElement object to its string representation. Use this method instead: ...


2

WebDriver cannot be used todo browser specific actions, it can only be used to drive the web-page. Although sending the keys CTRL-TAB might switch tabs WebDriver will still think you are in the previous window. Switching Tabs as you want is thus actually something different. Each tab is actually a window organised in a tab like look-and-feel. Thus you ...


2

Please use below xml file and from command prompt go to project location and run as "ant generateReport" (Should have ANT). Let me know if you have any questions. .xml file: <project name="TestAutomation" basedir="."> <property name="LIB" value="${basedir}/lib" /> <property name="BIN" value="${basedir}/bin" /> <path ...


2

Setting up Selenium tests to run on Safari browser is a fairly complex process. You need to install Safari Extensions Developer Certificate in your machine and also install selenium webdriver as an extension in Safari Browser. Also there are some stability issues with Safari browser automation & Selenium combination on Mac 10.9 OS and below. The ...


2

If you are testing for a specific image at a specific resolution then you could either compare the image with the reference image or quicker calculate the MD5 of the image and compare it with the expected. Be sure and wait for the page to be loaded, including images, before validation.


2

It is a good programming practice to type the variable to be the the least-specific subclass that you actually care about. That way, your code is more reusable. In your case, if you actually need to call methods on FirefoxDriver that aren't defined on Webdriver, you should type Some_Variable to be FirefoxDriver. If you don't need to do anything ...


2

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 ...


2

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 ...


2

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


2

@Imen: I know below mentioned reporting techniques. And more important is how you want your reports (Line by line/step by step execution report, class/method level report, etc..?). What's the best appropriate method used by Selenium Testers to generate tests reports? Selenium will support multiple reports generation techniques. Testers will be using ...


1

There're 2 causes why this happens: The element has been deleted entirely. The element is no longer attached to the DOM. In your case, I think because the element j has not visible in slcsubType so, it cannot click on slctsubType.get(j).click(); I think you should use Explicit Wait and wait until these elements appear,and then click. Hope this helps. ...


1

Instead of downloading and using your own Selenium jars I would use Maven. Maven is used as a build tool and will download any dependencies you might need, like the latest version of Selenium. Steps: Download & Install Netbeans with JDK at http://www.oracle.com/technetwork/java/javase/downloads/index.html (Also install JUnit with the installer) ...


1

So selenium was created in java, so they have all of the advantages of updates and community for questions. I personally like C# because of my background with the .NET technologies. I know that people have recommended that I switch to java because of the community base, and how quickly things are updated for their technology. So to answer your question, none ...



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