Odin Technology - Automated Software Testing

Axe Test Automation Platform

General discussion relating to the Axe Test Automation Platform from Odin Technology

Posts by Odin employees marked:

Variable Page Titles

Hi

I am attempting to automate a helpdesk system that has variable page titles when a call is created (i.e. View Call 12345). Is there a way for Axe to place a variable in the Page title?

I am using Axe 3.51 with Selenium 2.33 in C#.

Thanks in advance

Jon
Jon Alsop Send private email
Monday, June 17, 2013
 
 
Hi Jon,
 
This can be done by overriding a default test suffix in the local test project’s action map. To override this part of the action map you need to add the new test suffix into the local project action map.
 The line of code that needs to be replaced is on the 8th line of code in the _testSuffix which is the line "                if (driver.Title == property[1])" as shown below:

public static void SetWindow(IWebDriver driver, WebDriverWait wait, string recstring)
        {
            string[] property = recstring.Split('=');
            DateTime start = DateTime.Now;
         
            while (DateTime.Now.Subtract(start).Seconds <= wait.Timeout.TotalSeconds)
            {
              if (driver.Title == property[1])
                {
                    return;
                }
                System.Threading.Thread.Sleep(500);
            }
            throw new Exception(String.Format("Window not found after {0}s. Expected: {1}, Actual: {2}", DateTime.Now.Subtract(start).Seconds, property[1], driver.Title));
        }

This code is at the beginning of the _testSuffix action and the rest of the code needs to be added to the local action map with the below change.

The code which the text needs to be replaced with is:
"if (driver.Title.Contains(property[1]))"

This code snippet will enable the user to define the Title in the Object map as a variable title which will enable the use code such as "title=View Call" to be used.

If you have any more questions on this solution then you can contact Odin Support at support@odintech.com

Best Regards

Alex
Alex Tracey Send private email
Wednesday, June 19, 2013
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics