Shadow Automation Selenium Versions Save

This project focuses on automation of multi-level shadow root dom using java selenium. You can embed this plugin in your java selenium project.

v0.1.5

5 months ago

This release is done to support Shadow library to be used with Selenium 4. Shadow 0.1.5 is tested and verified with Selenium 4.16.1

v0.1.4

2 years ago

Feature: Flexibility to use any depth levels of CSS and XPath.

v0.1.3

2 years ago

Implementation of Page Factory to find elements using css and xpath.

PageFactory:

  • @FindElementBy annotation can be used with PageFactory model to find elements based on css_selector or xpath.
  • To achieve this you will need to modify page initialization method as PageFactory.initElements(new ElementFieldDecorator(new DefaultElementLocatorFactory(driver), this).
  • For more example on PageFactory see this page.

PageFactory Example:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory;
import io.github.sukgu.support.ElementFieldDecorator;
import io.github.sukgu.support.FindElementBy;

public class LocalTestPage {
	
	WebDriver driver;
	
	@FindElementBy(css = "#container")
	WebElement container;
	
	@FindBy(css = "#h3")
	WebElement h3;
	
	@FindBy(css = "#h3")
	List<WebElement> allH3;
	
	@FindElementBy(css = "#inside")
	List<WebElement> insides;
	
	@FindElementBy(xpath = "//body")
	WebElement bodyByXPath;
	
	@FindElementBy(xpath = "//body//div[1]")
	WebElement divByIndex;
	
    public LocalTestPage(WebDriver driver) {
    	this.driver = driver;
    	ElementFieldDecorator decorator = new ElementFieldDecorator(new DefaultElementLocatorFactory(driver));
    	// need to use decorator if you want to use @FindElementBy in your PageFactory model.
    	PageFactory.initElements(decorator, this);
    }
    //... 
}

v0.1.2

2 years ago

Fixed issues #33 #25 and added enhancement #28

v0.1.1

3 years ago

fixed XPath issues.

v0.1.0

3 years ago

Added the following methods to use XPath:

WebElement findElementByXPath(String XPath) : use this method if want a single element from DOM

List<WebElement> findElementsByXPath(String XPath) : use this if you want to find all elements from DOM

WebElement findElementByXPath(WebElement parent, String XPath) : use this if you want to find a single element from the parent object DOM

List<WebElement> findElementsByXPath(WebElement parent, String XPath) : use this if you want to find all elements from parent object DOM

Added highlight methods:

void highlight(WebElement element, String color, Integer timeInMiliSeconds) : highlight method.

void highlight(WebElement element) : highlight method highlight in red color.

For more information follow the link

v0.0.13

3 years ago

Fixed core library #16 specific issue for selectors with more than 2 levels.

v0.0.12

4 years ago

Now all methods for finding web elements will implement implicit waits internally. If implicitWait is once set it will work for following methods.

  1. WebElement findElement(String cssSelector)
  2. WebElement findElement(WebElement parent, String cssSelector)
  3. List<WebElement> findElements(String cssSelector)
  4. List<WebElement> findElements(WebElement parent, String cssSelector)
  5. WebElement getShadowElement(WebElement parent,String selector)
  6. List<WebElement> getAllShadowElement(WebElement parent,String selector)
  7. WebElement getParentElement(WebElement element)
  8. List<WebElement> getChildElements(WebElement parent)
  9. List<WebElement> getSiblingElements(WebElement element)
  10. WebElement getSiblingElement(WebElement element, String selector)

v

4 years ago

v0.0.11

4 years ago

This feature will add wait methods on shadow objects Currently, we are not able to use selenium implicit and explicit waits on shadow objects. This feature will methods like selenium that will work for shadow objects.

Additional context After this fix user will be able to use shadow objects waits in the same way they use selenium waits and this will work for both normal DOM elements and shadow DOM elements.

Added 2 methods setImplictWait(int seconds) and setExpilictWait(int seconds, int pollingTime).