0

I am trying to login to hotmail, and click the first email that is shown in the emails box. I get a problem, when I'm trying to find the first email.

I've tried to get it in a lot of different ways, but I've wanted to make a test just by finding all the list items li, so I've made a simple function:

public void clickFirstEmail()
        {
            var lis = driver.FindElements(By.TagName("li")); //this is raising the exception
            foreach (var li in lis)
            {
                MessageBox.Show(li.Text);
            }
        }

Whenever I try to access some elements, I get this exception: Permission denied to access property '__qosId'

I've seen some answers here on stackoverflow, but I guess they are right when you are running a selenium server.

I start my driver like this:

driver = new FirefoxDriver();

Any ideas on how to get this right ?

The whole plan is to click the first email.

UPDATE: I've tried one more time, and it worked, but it gave me this error now: Element is no longer attached to the DOM on the messagebox.show line.

I am thinking that the page (javascript) is constantly loading/changing new stuff, so what could I do about this ?

  • 3
    Number of things: a) Selenium or any browser automation tool is by far the most useless way to do this. API's exist to allow you to connect to & read emails without the need for a browser, b) What's the full stack trace? and c) What version of Firefox & Selenium are you running? – Arran Apr 23 '14 at 14:23
  • 1. From what I see it's just that error, even if I click view details 2. I know, but it needs to be done like this. 3. FF 28.0 and Selenium 2.41.0.0 – user3564958 Apr 23 '14 at 14:27
  • So what line causes the exception? Why does it need to be done like this? – Arran Apr 23 '14 at 14:29
  • just edited my question – user3564958 Apr 23 '14 at 14:34
  • The error message is clear that you are missing key automation elements here: http://stackoverflow.com/questions/5709204/random-element-is-no-longer-attached-to-the-dom-staleelementreferenceexception ...I'd suggest you take a look at the documentation. It goes into lengths about this. http://docs.seleniumhq.org/exceptions/stale_element_reference.jsp – Arran Apr 23 '14 at 14:43

0 Answers0