2017-06-11 1 views
0

Ich versuche ein Registrierungsformular in Selenium IDE zu testen, das Textwerte in Eingabefelder mit dem type Befehl eingeben soll.Selenium IDE gibt keinen Text in das Eingabefeld ein

Wie auf dem Bild zu sehen ist, werden die Textfelder nicht als gefüllt erkannt und daher ist die Schaltfläche Senden nicht verfügbar.

Wie kann das behoben werden?

Ich habe auch versucht, mit click, clickAt, focus Befehle vor type, aber das auch nicht funktioniert hat.

enter image description here

<?xml version="1.0" encoding="UTF-8"?> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
 

 
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> 
 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
 
    <link rel="selenium.base" href="http://localhost:8090/" /> 
 
    <title>registr</title> 
 
</head> 
 

 
<body> 
 
    <table cellpadding="1" cellspacing="1" border="1"> 
 
    <thead> 
 
     <tr> 
 
     <td rowspan="1" colspan="3">registr</td> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
     <tr> 
 
     <td>open</td> 
 
     <td>/registration</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[1]/input</td> 
 
     <td>vvv</td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[2]/input</td> 
 
     <td>[email protected]</td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[3]/input</td> 
 
     <td>12345</td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[4]/input</td> 
 
     <td>12345</td> 
 
     </tr> 
 
     <tr> 
 
     <td>click</td> 
 
     <td>name=nextStep</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[1]/input</td> 
 
     <td>vvv</td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[2]/input</td> 
 
     <td>vvv</td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[3]/input</td> 
 
     <td>vvv</td> 
 
     </tr> 
 
     <tr> 
 
     <td>click</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[4]/input</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>click</td> 
 
     <td>xpath=(//button[@type='button'])[3]</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>click</td> 
 
     <td>xpath=(//button[@type='button'])[3]</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>click</td> 
 
     <td>xpath=(//button[@type='button'])[36]</td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>type</td> 
 
     <td>xpath=//body/div/div/div/div[2]/div/div[2]/form/div[3]/input</td> 
 
     <td>Los-Angeles</td> 
 
     </tr> 
 
    </tbody> 
 
    </table> 
 
</body> 
 

 
</html>

+0

Bitte geben Sie den HTML-Code dieses Formulars an. Haben Sie vor dem Validierungsversuch versucht, eine kleine Pause hinzuzufügen (nur zum Debuggen)? –

+0

@ Y-BCause Ich habe versucht, es Schritt für Schritt zu debuggen, aber das hat nicht geholfen – andynitrox

+0

Sorry, wenn ich nicht klar war, sprach ich über den HTML-Code des SUT, nicht Ihr Selenium IDE-Skript. –

Antwort

1

hatte einfach eine Heureka! Moment. Ich würde vorschlagen, dass Sie die sendKeys Funktion anstelle der type Funktion verwenden. Die sendKeys Funktion simuliert das Keyboard Keypress Event, welches von diesem Formular benötigt wird.

+0

Perfekt, das hat es behoben! Vielen Dank! – andynitrox

Verwandte Themen