Home > database >  Why value sent to Text box gets disappeared in web application
Why value sent to Text box gets disappeared in web application

Time:11-17

I am trying to Input text into text box using the Robot framework selenium library and the same gets vanished just after typing. The script passes but the value is not actually passed

input text

//*[text()="Daily Order Limit"]/../../../input    150

I have tried to put more, Click the element and then Input text, Wait until element visible/enabled.

CodePudding user response:

If this the HTML Code of text box element

<input aria-invalid="false" name="limit" placeholder="Daily Order Limit" 
type="number"  value="">

You can use the below mentioned xpath

Input Text   //input[@class='MuiInputBase-input MuiOutlinedInput-input']   150

            OR

Input Text    //input[@placeholder='Daily Order Limit']    150

CodePudding user response:

You see the text getting filled in, but it disappears after typing? Sounds like the page is not fully loaded yet, as in the input is loaded but some ajax/javascript/... refreshes the page. Normaly you wouldn't noticr but Selenium is SO fast that it happens.

Try this: Sleep 5s //*[text()="Daily Order Limit"]/../../../input 150

Note that Sleep or hard waits in general are a bad solution. If this works, the next step is figuring out how to detect when the page is REALLY finished loading.

  • Related