0

I have tried many different XPATH but still I am not able fetch city from displayed list and perform click on it.I have posted this question earlier also suggested answers couldn't help.With my code was just able to see list but couldn't click from list displayed.Can anyone please see what exactly the problem because it's my project.All Answers will be highly appreciated and will be helpful.

HTML STRUCTURE

<input ng-if="isGoogleMapsAvailable()" required="" type="text" id="city" name="city" ng-model="registrationData.city" ng-minlength="2" validation-match="selectedCity" ng-change="cityFieldEdited()" ng-class="{'ng-touched': forms.userForm.city.$valid, 'auto-detected': autoDetectAddress.city}" tabindex="1" class="ng-pristine ng-valid-minlength ng-not-empty ng-valid-validation-match ng-valid ng-valid-required ng-touched auto-detected" placeholder="Enter a location" autocomplete="off" style="">
<div class="pac-container pac-logo" style="width: 288px; position: absolute; left: 495px; top: 141px; display: none;">
    <div class="pac-item">
        <span class="pac-icon pac-icon-marker"></span>
        <span class="pac-item-query">
            <span class="pac-matched">Chicago Heights</span>
        </span>
        <span>IL, USA</span>
    </div>
    <div class="pac-item">
        <span class="pac-icon pac-icon-marker"></span>
        <span class="pac-item-query">South 
           <span class="pac-matched">Chicago Heights</span>
        </span>
        <span>IL, USA</span>
    </div>
    <div class="pac-item">
        <span class="pac-icon pac-icon-marker"></span>
        <span class="pac-item-query">Arlington 
            <span class="pac-matched">Heights</span>
        </span>
        <span>IL, USA</span>
    </div>
</div>

suggestion for automating city

For HTML structure please refer the link

Thank you,

  • Please post the HTML structure HERE. It will change over time and we want this question to be readable for others in the future. So please post the HTML for the area you are targeting and the CSS and XPATH selectors you have tried. This site is for helping people now and in the future but is not a "please provide the answer to my specific problem at work for me so I can move on" – Michael Durrant Mar 17 '19 at 11:33
  • This is intended to help you. Otherwise close votes will likely come in and that will not help you of course. – Michael Durrant Mar 17 '19 at 11:34
  • 6
    Possible duplicate of facing difficulty to create dynamic xpath for City field of UTest website - Please don't post duplicate questions for the same problem. Refer to the answers in that question and ask more details if needed. – return Mar 17 '19 at 21:40
  • I believe its not worth of putting HTML structure because for clear understanding of flow need to visit and inspect element.@MichaelDurrant – shaikhsaliha Mar 18 '19 at 5:38