Question: My HTML code for a NEXT button which I am trying to click is:

```
<input type="submit" name="ctl00$ctl00$MainContent$ChildContent1$btnStep2_Submit" value="Next" onclick="waitBtn(event,&#39;df_step2&#39;);
                           OverlayProgressPanel_NoSub(&#39;ctl00_ctl00_MainContent_ChildContent1_fsLoanData&#39;,&#39;ctl00_ctl00_upProgress&#39;);
                           " id="ctl00_ctl00_MainContent_ChildContent1_btnStep2_Submit" class="btn" onmouseover="hov(this,&#39;btn btnhov&#39;);" onmouseout="hov(this,&#39;btn&#39;)" />

```

Am using the below code to click that next button:

```
        xpath = ".//*[@id='ctl00_ctl00_MainContent_ChildContent1_btnStep2_Submit' and @type='submit']";  // Next Button
        Function_Classes.field_click(driver,xpath);  // Click on Next button
        driver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS);

```

But,it looks like the button is getting clicked but not going to the next page where there is one more NEXT button 

I am getting below exception :

```
Unable to locate element: {"method":"xpath","selector":".//*[@id='ctl00_ctl00_MainContent_ChildContent1_btnStep3_Submit' and @type='submit']"}

ctl00_ctl00_MainContent_ChildContent1_btnStep3_Submit = this is the button on the next page and since I am not getting the next page on clicking the first NEXT button ,I would think that might be the reason..

```

Can you please help me here?

Answer: 
It's not clear to me what you're trying to do from your question and your view code confuses things further as you assign the result of `Plaque.objects.all()` to two different variables and then put them together. The `ForeignKey` objects on the `Plaque` model will all be available in the queryset. You can use [`select_related`](https://docs.djangoproject.com/en/1.10/ref/models/querysets/#select-related) to make sure you pull them all back efficiently, like so:

```
plaques = Plaque.objects.select_related("veteran").all()
for p in plaques:
    print p.veteran

```

N.B., the `.all()` isn't strictly necessary but I wanted to make it clear I was using the same query as you and simply adding to it.
You should be able to use the select\_related method. 

```
queryset_list = Plaque.objects.select_related('Veteran').all().order_by('first_name')

```

The detail is provided in the [Django documentation](https://docs.djangoproject.com/en/1.10/ref/models/querysets/#select-related).