Переменная C#+xPath

ftbwork10

Client
Joined
May 29, 2017
Messages
451
Reaction score
707
Points
93
Столкнулся с такой проблемой.

Если выполняю на странице такой код, то срабатывает отлично


Code:
Tab tab = instance.ActiveTab;



HtmlElement hePaginaton = tab.FindElementByXPath("//span[text()='user@yandex.ru']/following-sibling::mat-icon", 0);
hePaginaton.RiseEvent("click", "Full");
Но я хочу вместо user@yandex.ru вставить свое значение из переменной.
А вот такой код уже не срабатывает.

Code:
Tab tab = instance.ActiveTab;


string mail = project.Variables["user_email"].Value;
HtmlElement hePaginaton = tab.FindElementByXPath("//span[text()=' + mail + ']/following-sibling::mat-icon", 0);
hePaginaton.RiseEvent("click", "Full");
Почему?
 

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)