Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Pallavi Choudhary
Active particpant
Active particpant
Posts : 24
Join date : 2012-05-08

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Thu Jul 19, 2012 1:20 pm
I have one table having four columns and dynamic rows.
i want to click to the 4th cell of table which is link to the other page.
Please help me.

Thanks in advance.
Pallavi
avatar
jayanth
Posts : 2
Join date : 2012-07-19

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Thu Jul 19, 2012 4:59 pm
You can use regular expression to access dynamic links in the table
avatar
Pallavi Choudhary
Active particpant
Active particpant
Posts : 24
Join date : 2012-05-08

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Thu Jul 19, 2012 5:09 pm
Thanks for Rply.

Can you please give me the syntax.

I use this syntax but it is not working :

for (int i = 0; i < rowCount_tpsumry; i++)
{
selenium.click("xpath=(//a[@name='a1'])[position()=i]");
}

Thanks in advance.
Pallavi

avatar
jayanth
Posts : 2
Join date : 2012-07-19

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Thu Jul 19, 2012 5:22 pm
The following is the sample Regex code,

String htmlSource = selenium.getHtmlSource();

String patternformat = appName + "\\s+(.+?) id=\"(.+?)\"";
Pattern pattern = Pattern.compile(patternformat, Pattern.DOTALL | Pattern.MULTILINE);

Matcher matcher = pattern.matcher(htmlSource);
if (matcher.find())
value = matcher.group(2);
String edit = "id=" + value;

Here you can get the value of the particular link

Use www*regexplanet*com/advanced/java/index*html to find your group id by matching the string values
avatar
Pallavi Choudhary
Active particpant
Active particpant
Posts : 24
Join date : 2012-05-08

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Thu Jul 19, 2012 8:28 pm
Actually i am getting the value of the link which i want.
My problem is that i am not able to sun the script for all the values.
The following code will click on the link present on the first position.
selenium.click("xpath=(//a[@name='a1'])[position()=1]");
But i want to make it generalize.




avatar
srilathap
Active particpant
Active particpant
Posts : 18
Join date : 2011-10-11

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Sat Nov 10, 2012 9:24 pm
Hi,

HOW TO PASS MULTIPLE DATA THROUGH XLS SHEET with out using framwork.


I WANT EXECUTE MULTIPLE DATA.

pLEASE CAN U UPDATE
Sponsored content

How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop Empty Re: How Click on Dynamic Objects at Dynamic Positions in Selenium using for loop

Back to top
Permissions in this forum:
You cannot reply to topics in this forum