views:

256

answers:

3

Hi,

I'm trying to click on the panel links (links in the same page but different panel) in the page using Selenium RC. I'm able to do it by using:

browser.waitForCondition("selenium.isElementPresent(\"id=placeOrderLink\")", "30000")

but I want to make it generic and I tried to use:

String var="placeOrderLink";

browser.waitForCondition("\"selenium.isElementPresent(\\"id="+var+"\\")\"", "30000");

and it doesnt work! I get an error. I'm using Java to code my test suite.

+1  A: 

Try this browser.waitForCondition("selenium.isElementPresent(\"id=" + var + "\")", "30000")

Bhushan
+1  A: 

BTW: you don't need "id=controlID" when specifying control ID's in locators - control ID locator is the default one, so "controlID" is enough.

Igor Brejc
A: 

thanx bhushan, it worked!! thanx a lot and igor, thnx for u too buddy, i shall keep that in mind!!