我们如何获取Selenium RC for C#中当前页面的URL? [英] How do we get the URL of the current page in Selenium RC for C#?

查看:185
本文介绍了我们如何获取Selenium RC for C#中当前页面的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Selenium RC for C#中获取当前页面的URL。我不想获取图标的href属性,因为我想使用它来与URL进行比较,图标也会重定向您。

I am trying to get the URL of the current page in Selenium RC for C#. I don't want to get the href attribute of an icon, as I want to use it to compare it with the URL, the icon redirects you too.

推荐答案

假设您已将其定义为

say you have defined it as

         IWebDriver wb;
         wb = New FirefoxDriver();
         wb.Navigate.GoToUrl("http://gogoel.com");

然后获得当前的url使用

then to get current url use

          String ptr=wb.Url;

这篇关于我们如何获取Selenium RC for C#中当前页面的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆