java - Selenium: Element not found on session -


i using selenium rc java. req: click print links in page ends '?product=' , click 1 one.

the links doesn't have ids. therefore using xpath.

please check code.

selenium.open("http://s4.com"); int count= selenium.getxpathcount("xpath=//a[contains(@href, '?product=')]").intvalue(); for(int i=1;i<count;i++) {   selenium.click("xpath=//a[contains(@href, '?product=')]["+ +"]"); } 

this returns

14:19:27.907 info - command request: getxpathcount[xpath=//a[contains(@href, '?product=')], ] on session e4da58d4bf7d4eb6a7aa8238135fc969 14:19:28.950 info - got result: ok,4 on session e4dawerdfsdf34aa8238135fc969 4 14:19:28.956 info - command request: click[xpath=//a[contains(@href, '?product=')][1], ] on session e4dasdfs3434erererdf38135fc969 14:19:29.994 info - got result: error: element xpath=//a[contains(@href, '?product=')][1] not found on session e4da58d4bf7d4eb6afsd343fdsf135fc969 

i want print links too. there way?


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -