简体   繁体   中英

selenium cssselector in c# for kendo widget

I am having a hard time understanding CssSelector for an onscreen object I am trying to find (and others that are just like it). Give

<TH class=k-header id=c9a12c99-612c-4405-9b3d-fd551d03a10c role=columnheader rowSpan=1 jQuery111106564522723473856="19" data-role="columnsorter" data-index="0" data-title="SEQ" data-field="SequenceDays"><A tabIndex=-1 class=k-link href="#">SEQ</A></TH>

I want to identify this object by the tag and the data-title or data-field attribute.

Is anyone able to show me how to do this? C# would be preferable, but Java is ok too.

Thanks.

In Java: Tag + data title:

findElement(By.cssSelector("th.k-header[data-title='SEQ']"));

Tag + data field:

findElement(By.cssSelector("th.k-header[data-field='SequenceDays']"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM