Launch Browser in Incognito/Private Mode
Thought of sharing the code in the community for launching browsers in their incognito modes. The function is parameterized such a way to run for the browsers Internet Explorer, Edge, Chrome and Firefox. Hope it will be useful for more people. function runIncognitoMode(browserName){ //var browserName = "firefox" //iexplore,edge,chrome,firefox if (Sys.WaitBrowser(browserName).Exists){ var browser = Sys.Browser(browserName); Log.Enabled = false // To disable the warning that might occur during closing of the browser browser.Close(); Log.Enabled = true // enabling the logs back } if(browserName=="edge"){ Browsers.Item(btEdge).RunOptions = "-inprivate" Delay(3000) Browsers.Item(btEdge).Run(); }else if (browserName=="iexplore"){ Browsers.Item(btIExplorer).RunOptions = "-private" Delay(3000) Browsers.Item(btIExplorer).Run(); }else if (browserName=="chrome"){ Browsers.Item(btChrome).RunOptions = "-incognito" Delay(3000) Browsers.Item(btChrome).Run(); }else if (browserName=="firefox"){ Browsers.Item(btFirefox).RunOptions = "-private" Delay(3000) Browsers.Item(btFirefox).Run(); } Sys.Browser(browserName).BrowserWindow(0).Maximize() }3.8KViews8likes3CommentsCrossbrowser Object mapping: Object correctly detected in one browser not detected in the second
Hi all, just a post about something I've noticed when working with mapped object between Firefox and Chrome. I was having issues getting some mapped objects to be detected in the second browser having mapped successfully in the first. In all cases I was using some text property, e.e. innerText, to identify the object and there appeared to be no difference in the text property between the two browsers, when I examinded using object spy etc., and hence no obvious reason why the mapped object could not be found by testcomplete in the second browser What I have discovered after trial and error is that there appear to be unseen/invisible characters within the text property itself and that this is why testcomplete cannot identify the object in the second browser. Workaround I have found is to delete the extra invisible characters and also to wildcard the beginning and end of the text string. In namemapping editor select the object and open the edit object properties dialog, select the property and click the edit icon, object property edit dialog is presented. Click at the start of the string and use the "Delete" button on keyboard to remove any unseeen characters that may be occurring at the start of the string.(presence of unseen chars at start of a string is noticeable in that the cursor does not move even though the key has been pressed, until all unseen chars have been deleted at which point the string characters will then start to be deleted) Click at the end of the string to move the cursor and use both the Delete and Backspace keys to remove any potential unseen chars at the end of the string. (presence of unseen chars at end of a string is most noticeable when using Backspace, the cursor does not move even though the key has been pressed, until all unseen chars have been deleted at which point the text string characters will start to be deleted) e.g. I have a dialog with titie bar text Add task, which was not being detected by testcomplete in the second browser. I edited the innerText property value, performed the deletion and saved the changes. The dialog was then detected in the second browser. Ocassionally deletion of the unseen/invisible chars does not work and the object still cannot be found by testcomplete in the second browser. In these cases I also add wildcards to the beginning and end of the text string, after performing the deletion steps, and the mapped object is then correctly detected in the second broswer. For example: *Addtask* Hope this is of help to someone out there trying to figure out why your mapped objects are not being detected between different browsers. And if anyone can shed some light on what exactly is happening to create the unseen/invisible characters in the mapped object property I'd love to hear about it. Regards Tom.2.2KViews2likes3CommentsCannot create nameMapping template
TC 14.80.627.7 x64, Chrome 90.0.4430.212 Hi, i watched a demo that use nameMapping template, but when I try to create one, I got the error : "A template cannot be created from the Sys node that was mapped by selectors." I try in "Mapped Objects" section and "Aliases" section. I also try with a new object. Using XPath expressions and CSS selectors is enabled. Try with a new project. Video demo that I watched (go to 33min) : https://smartbear.com/resources/webinars/test-maintenance-tackling-the-hardest-part-of-func/?ws=A Is it possible to create nameMapping template for web element ? Thx to the SmartBear Community ! Martin C.Solved1.1KViews1like3CommentsChrome 69 and TestComplete
No question, just information. I wanted to head this off before we get all the questions about "Suddenly, my tests against Chrome stopped working". Chrome has recently updated from version 68 to version 69. TestComplete 12.50 has a patch for version 68 available athttps://support.smartbear.com/downloads/testcomplete/chrome-patches/ however, no patch for 69 is available yet. This doesn't mean it WON'T be available, just not yet. Best suggestion is to downgrade your version of chrome back to 68, reinstall the patch, and disable automatic browser updates for Chrome. I'm pretty confident that SmartBear will have a patch available eventually but, in the meantime, this should get you back up and going.1.7KViews1like1Comment