Class BrowsingContext

java.lang.Object
org.openqa.selenium.bidi.browsingcontext.BrowsingContext

public class BrowsingContext extends Object
  • Constructor Details

    • BrowsingContext

      public BrowsingContext(org.openqa.selenium.WebDriver driver, String id)
    • BrowsingContext

      public BrowsingContext(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WindowType type)
    • BrowsingContext

      public BrowsingContext(org.openqa.selenium.WebDriver driver, CreateContextParameters parameters)
  • Method Details

    • getId

      public String getId()
    • getTree

      public List<BrowsingContextInfo> getTree()
    • getTree

      public List<BrowsingContextInfo> getTree(String root)
    • getTree

      public List<BrowsingContextInfo> getTree(int maxDepth)
    • getTree

      public List<BrowsingContextInfo> getTree(String root, int maxDepth)
    • getTopLevelContexts

      public List<BrowsingContextInfo> getTopLevelContexts()
    • reload

      public NavigationResult reload()
    • reload

      public NavigationResult reload(ReadinessState readinessState)
    • handleUserPrompt

      public void handleUserPrompt()
    • handleUserPrompt

      public void handleUserPrompt(boolean accept)
    • handleUserPrompt

      public void handleUserPrompt(String userText)
    • handleUserPrompt

      public void handleUserPrompt(boolean accept, String userText)
    • captureScreenshot

      public String captureScreenshot()
    • captureScreenshot

      public String captureScreenshot(CaptureScreenshotParameters parameters)
    • captureBoxScreenshot

      public String captureBoxScreenshot(double x, double y, double width, double height)
    • captureElementScreenshot

      public String captureElementScreenshot(String elementId)
    • captureElementScreenshot

      public String captureElementScreenshot(String elementId, String handle)
    • setViewport

      public void setViewport(int width, int height)
    • setViewport

      public void setViewport(int width, int height, double devicePixelRatio)
    • setViewport

      public void setViewport(@Nullable Double width, @Nullable Double height)
      Set viewport size to given width and height (aka "mobile emulation" mode).

      If both width and height are null, then resets viewport to the initial size (aka "desktop" mode).

      Parameters:
      width - null or positive
      height - null or positive
    • setViewport

      public void setViewport(@Nullable Double width, @Nullable Double height, @Nullable Double devicePixelRatio)
      Set viewport's size and pixel ratio (aka "mobile emulation" mode).

      If both width and height are null then resets viewport to the initial size (aka "desktop" mode).

      If devicePixelRatio is null then resets DPR to browser’s default DPR (usually 1.0 on desktop).

      Parameters:
      width - null or positive
      height - null or positive
      devicePixelRatio - null or positive
    • activate

      public void activate()
    • print

      public String print(org.openqa.selenium.print.PrintOptions printOptions)
    • traverseHistory

      public void traverseHistory(long delta)
    • back

      public void back()
    • forward

      public void forward()
    • locateNodes

      public List<RemoteValue> locateNodes(LocateNodeParameters parameters)
    • locateNodes

      public List<RemoteValue> locateNodes(Locator locator)
    • locateNode

      public RemoteValue locateNode(Locator locator)
    • close

      public void close()