0

Hi i am using selenium with testng. I have created a code in which i will login to a website and then after that their is a operation that happens and it collects the name of all the ip addresses range given and after scanning their is a link that appears called SCAN COMPLETE. Now i have to wait for such link and after that i will logout.I use

selenium.waitforElemenPresent("link=SCAN COMPLETED"); 

Since on page this element is already present but hidden so it doesn't works. So i need to wait for such link to appear on the screen and after that i logout.

Any suggestions.

2
  • try for something like that SeleniumUtils.waitForElement(selenium, "id=your_id"); Commented Sep 27, 2011 at 9:27
  • it will not work as the element is hidden in the page and this command will be true always so no waiting is their for scan to complete. Commented Sep 27, 2011 at 9:29

1 Answer 1

2

I assume you are using Selenium RC. One option is to wait for the element using XPath. This way you can also check for the display attribute.

So say the link looks something like this (notice the display attribute):

<a href="#" style="display: none">SCAN COMPLETE</a> 

You can wait for it to be visible with:

selenium.waitForElementPresent("//a[text()='SCAN COMPLETE' and not(contains(@style, 'display: none'))]"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.