Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protractor get element by name tag

Currently I am working with protractor and Selenium web Driver.

I have the following problem:

I have a html page, and I make protractor clicking a button. Then a window pops up. This window contains a text box with the Name "Description":

<input type="Text" name="Description" ... />

Now when I try the following:

element(by.css('[name="Description"]')).sendKeys("rabbababab");

The browser does nothing, but protractor does not throw an error. No text is typed into the TextBox. Unfortunatelly, the name is the only way to identfy the input-TextBox.

What am I doing wrong?

like image 856
Adrian Melzer Avatar asked Dec 19 '22 23:12

Adrian Melzer


2 Answers

Selecting directly by name works as well:

element(by.name('Description')).sendKeys("rabbababab");
like image 69
mooses Avatar answered Dec 28 '22 22:12

mooses


OK guys, ive found the issue.

It wasnt an alert, its just a div, and all other controls are locked for user Input. but the Dialog covers a TextBox, wich has the same css-properties. So protractor just writes into the covered TextBox and i couldnt see it...

The Problem is solved

like image 25
Adrian Melzer Avatar answered Dec 28 '22 22:12

Adrian Melzer