最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - Selenium Automation Problems - Stack Overflow

programmeradmin2浏览0评论

I'm new to Selenium and am using Firefox as my browser.

On the webpage I'm trying to automate there is a tableCell that changes depending on the page selected. It starts out with "First" "1" "2" and "Last" with the following html and page 1 is visible and current.

<tr class="tableRow" xpath="1">                    
<td class="tableCell" colspan="4">&nbsp;</td>                      
<td class="tableCell centerAlign" colspan="3">   
<div id="First">  
<span>&lt; First</span>  
</div>  
<div id="Numbers" style="">  
<span>1</span>  
<a href="javascript:void(0);">2</a>  
</div>  
<div id="Last">  
<a href="javascript:void(0);">Last &gt;</a>  
</div>  
</td>  
</tr>  

After I fill in all 14 data rows I click "2" to go to the next page. When I do, the html stays the same except the following.

<div id="Numbers" style="">  
<a href="javascript:void(0);">1</a>  
<span>2</span>  
<a href="javascript:void(0);">3</a>  
</div>  

After I fill in all of those 14 data rows I click "3" to go to the next page. When I do, the html stays the same except the following.

<div id="Numbers" xpath="1">  
<a href="javascript:void(0);">2</a>  
<span>3</span>  
<a href="javascript:void(0);">4</a>  
</div>  

After I fill in all of those 14 data rows I click "4" to go to the next page. When I do, the html stays the same except the following.

<div id="Numbers">  
<a href="javascript:void(0);">3</a>  
<span>4</span>  
<a href="javascript:void(0);">5</a>  
</div>  

I can fill in the first 14 rows and select page 2 afterword by using the following:

driver.FindElement(By.XPath("//div[@id='Numbers']/a[1]")).Click();

It goes to page 2 and lets me fill in all 14 rows but don't always show and update the "tableCell centerAlign" to "First" "1" "3" and "Last".

I can't figure out how to make it show the updated "tableCell centerAlign", and even if it does, and I can't figure out how to make it go from page 2 to page 3, then 4, and then 5 when those pages are filled in.

Can someone help me out?

发布评论

评论列表(0)

  1. 暂无评论