0

I have a form which requires its data consists of textbox, combo box etc and finally i need to save.

Please find below outer HTML pattern of save button:

<input type="submit" name="ctl00$ContentPlaceHolder1$btnEditSave" value="Save" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$btnEditSave&quot;, &quot;&quot;, true, &quot;vgExhibitor1&quot;, &quot;&quot;, false, false))" id="ContentPlaceHolder1_btnEditSave" class="green-btn">

The problem is when I use id /name/xpath with this element for the first time for example, to get the validation on clicking on save without filling data on the form, it's working fine but when I fill all data and do the same it does not save rather it throws

`**"Caused by: org.openqa.selenium.NoSuchElementException: no such element"**`

Please suggest me on this .

0

2 Answers 2

0

Thanks for your quick reply on this. The issue is that the form has one iframe. Before saving the complete form I did not switch to the default content from child to parent so elements were not able to be picked up by selenium api.

0
0

Might be xpath of save button gets changed after first submission, try to shorten your xpath and eliminate unwanted div tag if any, try using following xpath

//input[@value='Save']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.