selenium - WebDriver - sendKeys(input) does not complete before sendKeys(Keys.RETURN) -


My test is entering a key in a search text box, which is mostly Ajax, and then by pressing the entry from the keyboard. There is no button to start searching so that we can use the enter key.

I am using the ChromeDrOr because Firefox is not supported for our application in relation to this flow.

For my WebDriver code (Java), I have to:

  searchIcon.click (); // search box opens the Ajax overlay of searchbox.clear (); // searchBox.sendKeys (input) from whatever text is already there; // input text enters search box.sendKeys (Keys.RETURN); // Press back to start the search   

The problem is, I have found that the input text is not yet fully typed in the text box and the return has already been done. Actually, I am searching for part of the input text that was entered.

Anyone is facing this? I tried to add an implication before the return action but because the elements are already loaded, it is not helping.

Try it out, once you enter the input into the search box, check that the text is complete If present is present or use the statement again inside the text box, if the whole text is present then the sender (keys.) Part.

Just give it a try because once you enter text in the text box, this element will be revealed in the next step.

Thank you, Shravan Kumar.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -