xpath or css needed for following html snippet -


The following HTML code produces pop-ups to add to the product that is trying to find the exches or CSS that selenium Which will allow the button to click on "Add" to add the "product" button.

I tried to use this xpath // div [18] / div [2] / div / button which only works for a session. When you close the browser and reopen, then XP does not work above. So, how can we write such a xpath, which does not have to give div [number] in this case [18].

  & lt; Div style = "height: auto; min-height: 104 pixels, width: auto;" class = "dialogue ui-dialog-content ui-widget-content" & gt; & Lt; Fieldset & gt; & Lt; Story & gt; Search & lt; / Narrative & gt; & Lt; Div id = "namoride" & gt; & Lt; Input type = "radio" & gt; Name & lt; Input type = "radio" & gt; Id & lt; / Fieldset & gt; & Lt; Div style = "clear: both; padding-top: 5px; float: right;" Gt; & Gt; Button class = "add" & gt; Add & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt;    

First of all, this HTML is not valid: namespaces Before closing the fields, the division does not stop typo?

If you can influence HTML, then try adding the ID or the class attribute to the external partition so that you can target them with the CSS selector. If you can look like HTML

  and 

then you can use the selector < Code> # foo button.add .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -