Selenium WebDriver对象可在所有测试/类中使用

编程入门 行业动态 更新时间:2024-10-10 23:20:53
本文介绍了Selenium WebDriver对象可在所有测试/类中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我会撒谎地知道如何在所有测试和类中声明和使用WEbDriver对象. 由于WebDriver是驱动程序(firefix/IE/Opera ..),因此我想在所有类中使用它来识别应用程序中的网络元素, 目前正在关注,

Hi All, i would lie to know that how i can declare and user WEbDriver object across all the tests and classes. since WebDriver is the driver (firefix/IE/Opera..) so i wanted to use in all the classes to identifying webelements in th application, currently am following as,

Class main(){ Function Navigate(){ WebDriver drive=New FireFoxDriver(); } }

但是如果我想在另一个名为getAll 的类中使用相同的驱动程序 目前正在关注,

but if i want use same driver in another class called getAll currently am following as,

Class getAll(){ Function Listval(){ driver.getelement(by.id("jk") } }

它将(驱动程序对象)在这里工作(getAll类)吗? 是一个新手,将使用Webdriver selenium来自动化应用程序. 我很感谢您的解决方案,并热切希望看到.

will it(driver object) work here(getAll class) ? am new to this and going to use Webdriver selenium to automate the application. I can appreciate you solution and keen to see.

推荐答案

如果您询问硒专家 [ ^ ]这个问题. 我们始终可以为您提供标准代码的帮助,但是,如果您在寻找产品特定的帮助,最好总是寻求源代码,因为这里不能保证有人能使用它. You will have more chance if you ask the Selenium Guys[^] this question. We can always help with standard code, but if you are looking for product specific help, it is always better to go to source as there is no guarantee anyone here uses it.

更多推荐

Selenium WebDriver对象可在所有测试/类中使用

本文发布于:2023-11-27 22:40:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639895.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可在   类中   对象   测试   Selenium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!