Contributions
Re: Internet Explorer outerHTML and innerHTML missing closing tags on table objects <th> and <td>
We managed to find a solution. The tags that IE wasn't returning (</td> and </th>) are considered optional tags in HTML5. The utility we used for building our web application was configured to automatically strip optional HTML tags to "minify" the code for performance reasons. So while our source code included those tags, it was being stripped during our build process. We changed our build process to not strip the tags anymore and it's been working since. Thank you for the help, it's greatly appreciated.1.9KViews1like1CommentInternet Explorer outerHTML and innerHTML missing closing tags on table objects <th> and <td>
I am trying to convert HTML tables to XML, but when performing the conversion on a Table object in IE, I get an error about tags not matching. The function I'm running is: while True: if (ReportObj.VisibleOnScreen == True): XMLdoc = Sys.OleObject["Msxml2.DOMDocument.6.0"] xmlstring = ReportObj.outerHTML XMLdoc.loadXML(xmlstring) # This is the part of the function throwing the error below return XMLdoc The exact error in TestComplete is: End tag 'tr' does not match the start tag 'th' In Chrome, FF, and Edge this function works fine, only IE gives me the problem. After some digging, I've tracked it down to the outerHTML and innerHTML properties not returning the closing </th> or </td> on the table in TestComplete, which is what is breaking the XML conversion. After the </button> tagit should have a </th> tag. I've inspected the element in IE and verified that it includes the </th> tag. <th style="width: 7.69%;">Plan Name <button uib-tooltip-html="tipPlanName" tooltip-trigger="mouseenter click" tooltip-class="help-swui">?</button> When I run the same thing in Chrome, it returns correctly: <th style="width: 7.69231%;">Plan Name <button uib-tooltip-html="tipPlanName" tooltip-class="help-swui" tooltip-trigger="mouseenter click">?</button></th> Does anyone know why I can't get the closing tags to show properly in TestComplete?Solved2KViews0likes3CommentsRe: Unable to create table checkpoint from Web page table
I tried posting this earlier, but it looks like it didn't take. Thank youTanyaYatskovskafor getting that back up. Thankstristaanogre. I haven't tested the script extension yet, but thanks for updating it. I have msxml6.0 on my machine, so I think you update should work for me. If not, I'll fiddle with it. My code seems to be a barebones version of the HTML script extension, so I'll compare them. Anyway, for recording purposes, here's an implementation without the script extension that worked for me. # Python # Using a global dictionary to reference be able to reference XML stores by a friendly name TableDict = {"MyTable1":XML.FirstTable, "MyTable2":XML.SecondTable, "MyTable3":XML.ThirdTable} # TableAlias is the table on the webpage you want to turn into XML, it must has an outerHTML property def GetTableOnScreenToXML(TableAlias): try: XMLdoc = Sys.OleObject["Msxml2.DOMDocument.6.0"] TableHTML = TableAlias.outerHTML.replace("<br>",'') # the replace function is needed to delete any unclosed tags like <br> XMLdoc.loadXML(TableHTML) return XMLdoc except Exception as e: Log.Error("Error: " + str(e.args[0])) # Take on screen report and turn put it in the XML Store def CreateXMLCheckPoint(StoreName, TableAlias): # StoreName = "FirstTable" # TableAlias = Aliases.browser.Reports.Table try: OnScreenXML = GetTableOnScreenToXML(TableAlias) if (XML.CreateXML(StoreName, OnScreenXML)): Log.Message("XML Checkpoint created") except Exception as e: Log.Error(str(e.args[0])) # The same GetTableOnScreenToXML() is used to get the table on screen, and then the Check() function is run to verify it matches the XML store def ValidateTable(StoredXMLName): # StoredXMLName refers to the XML Store of the table you want to validate OnScreenTable = GetTableOnScreenToXML(TableAlias) XMLCheckpoint = TableDict.get(StoredXMLName) XMLCheckpoint.Check(OnScreenTable) # Testing that you can validate the HTML table against the stored XML document def TestValidateTable(): ValidateTable("MyTable1")3.3KViews1like0CommentsRe: Unable to create table checkpoint from Web page table
That sounds like a good idea. Thanks for the script extension, I'll give it a shot. In the mean time, here's the basic form of the code I wrote. The basic workflow is like this: 1. Take the on-screen table and covert it to an XML doc 2. Then either store it as a Checkpoint or compare it to a checkpoint. This is the solution I wrote in Python. It is currently hardcoded to look for a specific table, but it can be expanded on to allow passing in any HTML table that is mapped as an Alias, or found using FindChild or something. # Converts an HTML Table to an XML doc # Used for creating XML checkpoints of tables AND validating tables against checkpoints def OnScreenTableToXML(): try: # Using MSxml 6.0 on my machine. Some people may need to use 3.0 XMLdoc = Sys.OleObject["Msxml2.DOMDocument.6.0"] HTMLTable = Aliases.tableTable.outerHTML.replace("<br>",'') # Replace is used to fix any unclosed tags in the HTML. Can't create an XML doc with unclosed tags like <br> XMLdoc.loadXML(HTMLTable) return XMLdoc except Exception as e: Log.Error("Error: " + str(e.args[0])) # This example is used read the on-screen Table and # stores it as an XML Checkpoint for future use. # After running this, the new checkpoint will show up under Stores > XML in the Project Explorer. def CreateXMLCheckPoint(): StoreName = "MyFirstTable" try: OnScreenXML = OnScreenTableToXML() if (XML.CreateXML(StoreName, OnScreenXML)): Log.Message("XML Checkpoint created") except Exception as e: Log.Error(str(e.args[0])) # I created a dictionary to map simple names to the XML Stores # This is stored outside of any function and is globally available to functions in the script TableDict = {"TableOne":XML.MyFirstTable, "TableTwo":XML.MySecondTable, "TableThree":XML.MyThirdTable} # After a checkpoint as been created for MyFirstTable, we can use this to validate an on screen table against the Store def ValidateTable(): TableName = "MyFirstTable" OnScreenTable = OnScreenTableToXML() XMLCheckpoint = TableDict.get(TableName) XMLCheckpoint.Check(OnScreenTable)3.3KViews0likes0CommentsRe: Unable to create table checkpoint from Web page table
Thanks for the help and guidance. Yesterday, I was able to implement your method using XML checkpoints to validate the HTML table. I'm working through some of the finer details now to make it more robust. This might be a working solution although I'd still like to get a hold of that HTML table extension script. If Tanya can find the extension I'd be more than happy to try that out too. I'd like to have multiple options to show to my team to see which way we'd like to go. Thanks3.3KViews1like17CommentsUnable to create table checkpoint from Web page table
I tried looking around here for a while before posting this, but I'm at a loss. I am trying to create a table checkpoint for an HTML table on a webpage using TestComplete 12.50. The table is generated with AngularJS, but outputted table is just a simpleHTML table. The problem I'm having though is I keep receiving the error message "Unable to retrieve table data for the checkpoint". Possible causes list: 1. The select object is not supported by table checkpoints 2. The selected object is not a tabular control Under the help documentation there is a link for adding a script extension for HTML table checkpoints, which I'd really like to try and use, but the link on the web page goes to a 404. https://blog.smartbear.com/software-quality/new-testcomplete-html-table-checkpoint-simplify-creation-of-tests-for-web-applications/ Does TestComplete support HTML table checkpoints naively now without the extension? Where can I get an updated script extension if I need one? I am able to create object property checkpoints, but I'd really like to avoid having to maintain hundreds of cell checkpoints, when I feel like I should be able to store a table checkpoint.Solved4.4KViews0likes20CommentsRe: Opening new tab in Firefox 60.0 returns wrong URL with Page("*").URL
I think you solved the mystery. After opening a new tab, I'm getting two "new" pages in the Object Browser. A page for "about:newtab" and the new "localhost" page that I was looking for and hierarchical wise appears to be finding the "about:newtab" first. I haven't implemented a solution yet, but I see where the issue is. Thank you.1.9KViews0likes0CommentsOpening new tab in Firefox 60.0 returns wrong URL with Page("*").URL
In TestComplete 12.50.4142, I'm using Firefox 60.0 to open a new tab and verify the URL matches the URL in another tab. When I do this in IE or Chrome, it works fine. But when I try it in Firefox it fails. I'm usingSys.Browser().Page("*").URL to pull the URL on the second tab and it is always returning "about:newtab" instead of the actual URL "http://localhost". If I useSys.Browser().Page("*").URL to pull the URL from the first tab, it reports "http://localhost". I tried adding check for WaitPage("http://localhost") and it still fails. Is this a bug? Both Firefox and TestComplete are up to date all the way. I already ran throughhttps://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/firefox.html for setting up Firefox.Solved2KViews0likes5CommentsIs Selenium integration useful for companies that plan only on using TestComplete Web?
Forgive me if this is a silly question, but there is a webinar for Selenium integration with TestComplete and I was wondering, are there additional benefits to using Selenium with TestComplete if you do not already have Selenium test scripts? Soon we are starting to create automations for our web app. It seems that the webinar is more for people transitioning from Selenium to TestComplete Web and wanting to reuse test scripts. We already use TestComplete for automated testing and plan on using TestComplete Web for all of our web testing. Is there any more benefit to adding Selenium in line with TestComplete for web testing, if you don't already use Selenium? https://smartbear.com/resources/webinars/optimizing-selenium-with-smartbear/961Views1like2Comments