jeudi 7 juin 2018

C# Selenium web driver can't tick a check box

Have an issue here. My scenario need to tick a check box to be completed and the selenium web driver can't do that as the check box as an element has two location Identifiers in selenium IDE (Xpath and Id).

enter image description here

When defining the element by one only the code stops at the click action and can't tick the check box, the code is

public void Select_requirement_type_Checkbox_click()
    {
        var Checkbox = _webDriver.FindElementByXPath("//nav/ul/li[3]/tree-renderer/div/rm-checkbox/div/label");
        _webDriver.ExecuteScript("arguments[0].click();", Checkbox);
    } 




Aucun commentaire:

Enregistrer un commentaire