Codota Logo
ChromeDriver.getCurrentUrl
Code IndexAdd Codota to your IDE (free)

How to use
getCurrentUrl
method
in
org.openqa.selenium.chrome.ChromeDriver

Best Java code snippets using org.openqa.selenium.chrome.ChromeDriver.getCurrentUrl (Showing top 2 results out of 315)

  • Common ways to obtain ChromeDriver
private void myMethod () {
ChromeDriver c =
  • Codota Iconnew ChromeDriver()
  • Codota IconChromeOptions options;new ChromeDriver(options)
  • Codota IconCapabilities capabilities;new ChromeDriver(capabilities)
  • Smart code suggestions by Codota
}
origin: valord577/taobaoke

/**
 * @return 获取当前标签页的url
 */
public static String getCurrentUrl() {
  return getBrowser().getCurrentUrl();
}
origin: valord577/taobaoke

/**
 * 新建标签页 并打开网站
 * @return 返回新标签页的句柄
 */
public static String openTabAndFocus(String url) {
  String js = "window.open('" + BLANK + "', '_blank');";
  getBrowser().executeScript(js);
  String newHandle = getAllHandles()[1].toString();
  getBrowser().switchTo().window(newHandle);
  if (getBrowser().getCurrentUrl().startsWith(BLANK)) {
    getBrowser().get(url);
    return newHandle;
  }
  for (Object o : getAllHandles()) {
    getBrowser().switchTo().window(o.toString());
    if (getBrowser().getCurrentUrl().startsWith(BLANK)) {
      getBrowser().get(url);
      return o.toString();
    }
  }
  throw new RuntimeException("未找到新建的空白标签页..");
}
org.openqa.selenium.chromeChromeDrivergetCurrentUrl

Popular methods of ChromeDriver

  • <init>
    Creates a new ChromeDriver instance with the specified options.
  • get
  • manage
  • executeScript
  • quit
  • findElement
  • close
  • execute
    Executes a passed command using the current ChromeCommandExecutor
  • getPageSource
  • getTitle
  • switchTo
  • findElementById
  • switchTo,
  • findElementById,
  • findElementByLinkText,
  • findElementByXPath,
  • getCapabilities,
  • getElementFrom,
  • getElementsFrom,
  • getExecuteMethod,
  • getExtensionDir

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now