Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
196 views
by Contributing Tester (82 points)

Can you tell me please how can I compare 2 sites ? 

 

https://cs.sportradar.com

https://csdev.sportradar.com

 

Lineups, Table, Head To Head 

This not work fine for me :(

 

 public static string GetInnerHtml(IWebElement element)
        {
            IJavaScriptExecutor executor = ((IJavaScriptExecutor)ObjectRepository.Driver);
            var remoteWebDriver = (RemoteWebElement)element;
            var javaScriptExecutor = (IJavaScriptExecutor)remoteWebDriver.WrappedDriver;
            var innerHtml = javaScriptExecutor.ExecuteScript("return arguments[0].innerHTML;", element).ToString();
 
            return innerHtml;
        }
       public string GetDataLineups()
        {
            
            string LineupsHtml = XMLHelper.GetInnerHtml(ObjectRepository.Driver.FindElement(By.XPath("//div[@class='srl-tab srl-tab-widgets-matchlineups selected sr-widget sr-widget-level-0 sr-widgets-matchlineups sr-large']"))).ToString();
            return LineupsHtml.ToString();
        }

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)
Instead of comparing InnterHTML, you should try comparing title, menu iteams and other elements manually. Since you are dealing with two different domain names, there are possibilities that generate source may not be the same. Atleast domain name inside your innerHTML will differ.

 

I would suggest you to compare important elements of the webpage.

 

Hope that helps.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...