Ich möchte Name Wert setzen Selen mit WebDriver in firefox (Bild unten sehen Sie bitte), aber das Textfeld präsentiert in Bootstrap Modell und es hat nicht Id oder Namen Attribut, es hat nur Platzhalter und Typen Attribut (bitte zweite Bild sehen). Ich arbeite für die letzten paar Stunden daran, aber nichts hilfreiches.Wie kann ich Wert in einem in einem Bootstrap Modell präsentiert Textfeld Platzhalter mit
ich unten Code versuchen:
> WebElement username = driver.findElement(By.xpath("//input[contains(@placeholder,'Name')]"));
Im Folgenden finden Sie einige Zeilen von HTML:
<div class="modal welcome__modal is-active">
<div class="modal__overlay welcome__modal__overlay" style="background-color: rgba(71, 70, 86, 0.1);"></div>
<div class="modal__content welcome__modal__content" style="padding: 10px 0px; width: 600px;">
<div style="overflow: auto; width: 100%;"><span style="opacity: 0;">_</span>
<div class="welcome__modal__content__wrap" style="display: flex; flex-direction: column;">
<div class="welcome__modal__content__heading"><a class="welcome__modal__content__heading__logo" style="display: flex; align-items: center; margin-top: 1px;"><img src="/5729a135ccb77ae7a0744b6903af9cb8.svg" alt=""><img src="/6e963a3bd5d0e46cfc51abd29cb5e047.svg" alt="" style="margin: 3px 0px 0px 10px;"><h1 class="sr--only">Primedice</h1></a>
<h3><span>The most <strong>popular</strong> and <strong>trusted</strong> Bitcoin gambling website.</span></h3>
</div>
<form class="welcome__modal__content__form" autocomplete="off"><input placeholder="Name" type="text"><button class="btn"><span><!-- react-text: 971 -->Join <!-- /react-text --><strong>3,241,212</strong><!-- react-text: 973 --> players now<!-- /react-text --></span></button></form>
<div class="welcome__modal__captcha is--hidden">
<div>
<div style="width: 304px; height: 78px;">
<div><iframe src="https://www.google.com/recaptcha/api2/anchor?k=6LeX6AcTAAAAAMwAON0oEyRDoTbusREfJa2vxDMh&co=aHR0cHM6Ly9wcmltZWRpY2UuY29tOjQ0Mw..&hl=en&type=image&v=r20171115120512&theme=light&size=normal&cb=c2gxjjpxcbva" role="presentation" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox" height="78" frameborder="0" width="304"></iframe></div><textarea id="g-recaptcha-response-1" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; display: none; "></textarea></div>
</div>
</div>
<p class="welcome__modal__content__login"><span>Already have an account?</span>
<!-- react-text: 978 -->
<!-- /react-text --><strong style="cursor: pointer;"><span>Login here</span></strong>
<!-- react-text: 981 -->.
<!-- /react-text -->
</p>
</div>
<p class="welcome__modal__content__terms"><small><span>By accessing the site I attest that I am at least 18 years old and have read the</span><!-- react-text: 985 --> <!-- /react-text --><span style="text-decoration: underline; font-weight: 600; cursor: pointer;"><span>Terms & Conditions</span></span><!-- react-text: 988 -->.<!-- /react-text --></small></p>
</div>
</div>
Jemand, bitte helfen Sie mir.
Wie geht? Wenn meine Antwort hilfreich war - bitte kreuzen Sie ein Häkchen neben der Antwort an. –