Once you've mastered these Chrome commands they're very powerful. Look very closely and you'll see it's the same usage every time. It will take a while, but eventually you'll get that eureka moment
Code: Select all
<select class="form-control" data-persistable="protection" id="ProduitSelectionne" name="ProduitSelectionne"><option selected="selected" value="PE10">Vie entière payable 10 ans - Patrimoine bonifié</option>
<option value="PF10">Vie entière payable 10 ans - Croissance accélérée</option>
<option value="PE20">Vie entière payable 20 ans - Patrimoine bonifié</option>
<option value="PF20">Vie entière payable 20 ans - Croissance accélérée</option>
<option value="PE00">Vie entière payable à 100 ans - Patrimoine bonifié</option>
<option value="PF00">Vie entière payable à 100 ans - Croissance accélérée</option>
</select>
Code: Select all
ChromeFindElements>session_id,xpath,//select[@class='form-control'],element
ChromeSetElementValue>session_id,element_1,Vie entière payable 20 ans - Patrimoine bonifié
To make it easier to see :
Code: Select all
<AAAAAAA BBBBBBB="CCCCCCC" data-persistable="protection" id="ProduitSelectionne" name="ProduitSelectionne"><option selected="selected" value="PE10">Vie entière payable 10 ans - Patrimoine bonifié</option>
<option value="PF10">Vie entière payable 10 ans - Croissance accélérée</option>
<option value="PE20">Vie entière payable 20 ans - Patrimoine bonifié</option>
<option value="PF20">DDDDDDD</option>
<option value="PE00">Vie entière payable à 100 ans - Patrimoine bonifié</option>
<option value="PF00">Vie entière payable à 100 ans - Croissance accélérée</option>
</select>
Code: Select all
ChromeFindElements>session_id,xpath,//AAAAAAA[@BBBBBBB='CCCCCCC'],element
ChromeSetElementValue>session_id,element_1,DDDDDDD
Here's a generic snippet worth saving. Once you understand what XX is (read and digest
this article - it will pay massive dividends later) we can find the element using ChromeFindElements. Then we can do one of three things with it. Get the data/value, Set the Value, or perform an action (click, submit, or clear).
Code: Select all
ChromeFindElements>session_id,xpath,//XX[@XX='XX'],el
//Get the data
ChromeGetElementData>session_id,el_1,text,increment_id
//Set the value to "Canada"
ChromeSetElementValue>session_id,el_1,Canada
//Do something
ChromeElementAction>session_id,el_1,click