<html class="no-js home_old_responsive_test" prefix="og: http://ogp.me/ns#" lang="en-US">
<body class="page-template page-template-page-templates page-template-custom-signup page-template-page-templatescustom-signup-php page page-id-29873 page-parent do-etfw muvi-child" data-spy="scroll" data-target="#main-navbar" id="29873">
<div class="container freetrail-container">
<div class="row frt_content_box">
<div class="col-md-6 col-sm-6 frt_form frt_rht_box">
<form method="post" name="userinfo" id="userinfo" novalidate="novalidate">
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input" name="name" id="name" value="" type="text">
<label class="fg-label">Name</label>
</div>
<label id="name-error" class="error" for="name"></label>
</div>
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input" name="companyname" id="companyname" value="" onblur="autofill_domain()" type="text">
<label class="fg-label">Company Name</label>
</div>
<label id="companyname-error" class="error" for="companyname"></label>
</div>
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input" name="phone" value="" type="text">
<label class="fg-label">Phone Number (with country code) </label>
</div>
<label id="phone-error" class="error" for="phone"></label>
</div>
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input inputchk" id="email" name="email" value="" type="text">
<label class="fg-label">Email</label>
</div>
<label id="email-error" class="error" for="email"></label>
</div>
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input" id="inputPassword" name="password" value="" type="password">
<label class="fg-label">Password</label>
</div>
<label id="inputPassword-error" class="error" for="inputPassword"></label>
</div>
<div class="form-group fg-float">
<div class="fg-line">
<input class="input-sm form-control fg-input" placeholder="yourdomainname." id="subdomain" name="subdomain" onkeyup="getdomainUrl();" onblur="getdomainUrl();" autocomplete="off" value="" style="padding-top:10px;" type="text">
<label class="fg-label fg-label-domain">Domain Name</label>
</div>
<label id="subdomain-error" class="error" for="subdomain"></label>
<label class="hintlbl2">Your website will be at <span class="domain-url">http://www.<span class="disabled subText" id="subText">yourname</span>.edocent.com</span>, you can change this later.</label>
</div>
<input name="studio_email" id="studio_email" value="" style="display: none;" type="text">
<div class="text-center">
<div><label class="checkbox checkbox-inline">
<input name="terms" type="checkbox">
<i class="input-helper"></i>
I agree to Muvi’s <a href="/agreements/muvi-terms-service" target="_blank" class="termservice">Term of Service</a>
</label>
</div>
<label id="terms-error" class="error" for="terms"></label>
</div>
<div class="form-group fg-float nxtbtnbox">
<input name="country" value="" readonly="readonly" type="hidden">
<input name="region" value="" readonly="readonly" type="hidden">
<input value="0" id="is_submit" name="is_submit" type="hidden">
<input value="" name="purchasetype" type="hidden">
<input value="" id="studio_id" type="hidden">
<button type="submit" id="nextbtn" name="nextbtn" class="btn btn-primary frt_btn">NEXT</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
Это моя форма, и мне нужно установить флажок с помощью xpath.Я попробовал следующие методы.
boolean s1 = driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[1]/form/div[7]/div/label/input")).isDisplayed();
и
boolean s1 = driver.findElement(By.xpath("//*form[@id='userinfo' and @name='userinfo']/div[7]/div/label/input[@name='terms']")).isDisplayed();
System.out.println(s1);
оба возвращают мне ложь. Пожалуйста, помогите мне, как проверить флажок.
Заранее спасибо.