I am trying to automate through selenium python to select a particular element from a list of element in a webpage. That is in the first page of the webpage I am selecting one list item from 5 items displayed, later I need to deselect them in the next page of the website where all the five numbers are listed. How can i select that particular element which i have select in the first page of the webpage?
The HTML code of the first page list item looks like this ->
<li class="ng-scope" ng-repeat="line in accountLines">
<label class="list-item inline-group">
<div class="inline-group-addon">
<div class="inline-group-main">
<p class="ng-binding">
</div>
and i have generated xpath as:
.//*[@id='oobe-login']/body/div[1]/main/div/div[1]/ul/li[1]/label/div[2]/p
.//*[@id='oobe-login']/body/div[1]/main/div/div[1]/ul/li[2]/label/div[2]/p
.//*[@id='oobe-login']/body/div[1]/main/div/div[1]/ul/li[3]/label/div[2]/p
.//*[@id='oobe-login']/body/div[1]/main/div/div[1]/ul/li[4]/label/div[2]/p
.//*[@id='oobe-login']/body/div[1]/main/div/div[1]/ul/li[5]/label/div[2]/p
and the HTML code of the next page is which lists all the element is:
li class="ng-scope" ng-repeat="line in allLinesList">
<a class="list-item inline-group reverse highlight" ng-click="expandSettings($index)" ng-class="(settings.selectedLine === $index && settings.expanded) ? 'active' : ''" href="">
</li>
I jus do a text check here which is a hard coding type to select the number that i have selected in the first page.
Can anybody suggest me an solution so that the selenium webdriver clicks each element in the next page and checks if it is registered, if registered, deregister it? Please Help.