这是有效的,但我想使用文本Group 1作为变量.
代码试用:
[FindsBy(How = How.XPath, Using = "(.//*[normalize-space(text()) and normalize-space(.)= 'Group 1'])[1]/ancestor::app-organization//*[normalize-space(text()) and normalize-space(.)='Create a new board...']/following::input[1]")]
public IWebElement BoardNameInputField { get; set; }
Run Code Online (Sandbox Code Playgroud)
我试过这个但没有成功:
string boardName = "Group 1";
[FindsBy(How = How.XPath, Using = "(.//*[normalize-space(text()) and normalize-space(.)='${boardName}'])[1]/ancestor::app-organization//*[normalize-space(text()) and normalize-space(.)='Create a new board...']")]
public IWebElement CreateNewBoard { get; set; }
Run Code Online (Sandbox Code Playgroud)
是否有可能做到这一点?
如何在不硬编码我的用户名和密码的情况下自动登录 Facebook?
我正在尝试创建一个新列表,执行两个 python 列表的逐元素子结构,如下所示:
from operator import add
number_villains_players = 0
villain_strength = []
player_strength = []
resulten_strength = []
def get_villain_strength(size):
villain_strength = [int(x) for x in input("Enter {} numbers of space separated strength of Villains:".format(size)).split()]
print(villain_strength)
def get_player_strength(size):
player_strength = [int(x) for x in input("Enter {} numbers of space separated energy of Players:".format(size)).split()]
print(player_strength)
def compare_strength():
#resulten_strength = [m-n for (m,n) in zip(player_strength,villain_strength)] #doesn't work
#resulten_strength = [sum(x) for x in zip(player_strength, villain_strength)] #doesn't work
#resulten_strength = [list( map(add, …Run Code Online (Sandbox Code Playgroud) xpath="1"最近,我在基于角度的应用程序中偶然发现了一个带有属性的元素。
HTML:
我无法找到有关此属性的任何详细信息,以及它在基于 Selenium 的测试的 xpath/cssSelector 中可能产生的影响和使用情况。
有人可以帮我任何方向吗?
selenium ×3
python ×2
python-3.x ×2
xpath ×2
angular ×1
c# ×1
chropath ×1
user-input ×1
xpath-1.0 ×1