Tag Info

Hot answers tagged

3

You should be splitting the xpath to fetch individual tables for clarity sake. I suggest the following: // Get the content or container WebElement content = driver.findElement(By.id("contentText")); //Get the table of users WebElement tblUsers = content.findElement(By.xpath(".//table/tbody/tr[2]/td/table/tbody/tr/td[1]/table")); // Get the rows which ...


2

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


2

Seems that you want to have a tool which can translate requirements/test cases (written by business people with no experience in programming) into executable code. In our practice FitNesse is not that tool. We started with FitNesse, and keep maintaining existing tests and even adding new when feasible, but these tests are written by developers, not business ...


2

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


1

You need to tell it to return the value. Change this line: String mainURL = (String) js.executeScript("productObj.mainURL"); to: String mainURL = (String) js.executeScript("return productObj.mainURL");


1

Use xpath. I don't know what language you're using, but in Python it would be: driver.find_elements_by_xpath('//div[@class="item"]')


1

You can use the "not" pseudo-class in a CSS selector like this: div.item:not(.sold-out)



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