Details
-
Type: Improvement
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: web-3.6
-
Component/s: Documentation
-
Labels:None
-
Number of attachments :
Description
When using the webDriver in the pages classes as follows:
public class Home extends AbstractPage {
private final WebDriver driver;
public Home(WebDriverProvider driverProvider)
{ super(driverProvider); this.driver = driverProvider.get(); }public void open()
{ get("http://localhost:8080/bignibou/"); manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); }public void enterDetails(String email, String status, String password)
{ driver.findElement(By.name("member.email")).sendKeys(email); driver.findElement(By.name("member.status")).sendKeys(status); driver.findElement(By.name("member.password")).sendKeys(password); }public void doRegister()
{ driver.findElement(By.name("member.doRegister")).submit(); }One get the following error:
WebDriver has not been found for this thread.
Please verify you are using the correct WebDriverProvider, with the appropriate credentials if using remote access, e.g. to SauceLabs: -DSAUCE_USERNAME=xxxxxx -DSAUCE_ACCESS_KEY=xxx-xxxx-xxxx-xxxx-xxx
Instead one has to use the webDriverProvider as follows:
public class Home extends AbstractPage {
private WebDriverProvider driverProvider;
public Home(WebDriverProvider driverProvider)
{ super(driverProvider); this.driverProvider = driverProvider; }public void doRegister()
{ driverProvider.get().findElement(By.name("member.doRegister")).submit(); }}
Maybe the error message could be more explicit.
Activity
Field | Original Value | New Value |
---|---|---|
Summary | WebDriver has not been found for this thread. Please verify you are using the correct WebDriverProvider, with the appropriate credentials if using remote access, e.g. to SauceLabs: -DSAUCE_USERNAME=xxxxxx -DSAUCE_ACCESS_KEY=xxx-xxxx-xxxx-xxxx-xxx | Improve documentation on use of WebDriverProvider to prevent error 'WebDriver has not been found for this thread.' |
Fix Version/s | web-3.6 [ 18388 ] | |
Affects Version/s | web-3.5.5 [ 18692 ] | |
Component/s | Documentation [ 11085 ] | |
Component/s | Spring Support [ 14534 ] |