automation

iMacros: click button or do not click (random choice)

浪尽此生 提交于 2020-01-05 09:23:57
问题 How can I set random choice for button 'click' or 'don't click'? In this example I need let iMacros make random action between like action and do nothing. TAG POS=1 TYPE=BUTTON ATTR=TXT:Like 回答1: As one of the ways to do what you need: SET butTxt "Like" SET butTxt EVAL("(Math.floor(2*Math.random()) == 0) ? 'No such button!' : '{{butTxt}}';") SET !ERRORIGNORE YES SET !TIMEOUT_STEP 0 TAG POS=1 TYPE=BUTTON ATTR=TXT:{{butTxt}} SET !ERRORIGNORE NO SET !TIMEOUT_STEP 6 回答2: var macro; macro = "CODE:

iMacros: click button or do not click (random choice)

这一生的挚爱 提交于 2020-01-05 09:22:46
问题 How can I set random choice for button 'click' or 'don't click'? In this example I need let iMacros make random action between like action and do nothing. TAG POS=1 TYPE=BUTTON ATTR=TXT:Like 回答1: As one of the ways to do what you need: SET butTxt "Like" SET butTxt EVAL("(Math.floor(2*Math.random()) == 0) ? 'No such button!' : '{{butTxt}}';") SET !ERRORIGNORE YES SET !TIMEOUT_STEP 0 TAG POS=1 TYPE=BUTTON ATTR=TXT:{{butTxt}} SET !ERRORIGNORE NO SET !TIMEOUT_STEP 6 回答2: var macro; macro = "CODE:

CodedUi :How to go about for search property of window when its title name keeps changing?

南笙酒味 提交于 2020-01-05 08:41:46
问题 I am trying to automate a click on control within window, and depending on what is selected within window, the tile of the window changes.Like sometime it is "abc",second time it will be "123".There is no common string in window title for two scenarios When I recorded the coded ui test, it assumed the title as "abc". Now I want to customize the test somehow, so that any title will work. How can I do so? Any help will be great. 回答1: You can change the searchProperties in runtime, like this:

How could I find an application window via it's ClassID?

徘徊边缘 提交于 2020-01-05 08:05:36
问题 I'm using White for test automation. I had created simple application test, which is tracking an application via it's dialog name. var appCalc = Application.AttachOrLaunch(new ProcessStartInfo("application.exe")); var wndCalc = appCalc.GetWindow("Dialog caption"); But this approach is unstable, because in different localisations, the caption could differ. How could i track my application, using it's ClassID? 回答1: var wndCalc = appCalc.GetWindow(SearchCriteria.ByNativeProperty

How to handle toast generate in android device while automating an app using appium?

懵懂的女人 提交于 2020-01-05 07:57:19
问题 I am trying to automate an android app using Appium and Webdriver. When i give invalid credentials to login into the app a toast appears, i want to assert the text of this toast.Also, I can't capture the screen shot of this toast using android uiautomatorviewr. How can i handle toast in android? Any Idea!! 回答1: Yes it is possible but only using uiautomator2, just pass the argument in the capability and use the below code: DesiredCapabilities caps = DesiredCapabilities.android(); caps

Android espresso - How to check value of TextView at the bottom of Listview?

自古美人都是妖i 提交于 2020-01-05 06:51:27
问题 In the attached image above, it is a ListView having TextView (delivery report) Its status can be 'Sent' or 'Sending' or 'Failed' I want to check for 'Sent' condition which means assert message sent successfully As it is a conversation, newer messages will be at the bottom of the listview. What I've tried is... // Type the message ViewInteraction smsEditText = onView(withId(R.id.text_editor)).check(matches(isDisplayed())); smsEditText.perform(typeText("abcde")); closeSoftKeyboard(); Thread

Android espresso - How to check value of TextView at the bottom of Listview?

我的未来我决定 提交于 2020-01-05 06:51:12
问题 In the attached image above, it is a ListView having TextView (delivery report) Its status can be 'Sent' or 'Sending' or 'Failed' I want to check for 'Sent' condition which means assert message sent successfully As it is a conversation, newer messages will be at the bottom of the listview. What I've tried is... // Type the message ViewInteraction smsEditText = onView(withId(R.id.text_editor)).check(matches(isDisplayed())); smsEditText.perform(typeText("abcde")); closeSoftKeyboard(); Thread

How do you run a command line program (like lame or svn) with PHP?

穿精又带淫゛_ 提交于 2020-01-05 05:42:44
问题 Specifically, I need to automate the encoding of audio files into mp3 with LAME. You don't need to know LAME to answer this, I could be talking about svn or some other program.. I know how to use LAME on the command line to do this, for one file at a time. I would like to do this via a php script however, so I can convert a bunch at once (for instance, all the files in a directory) So what I am confused about, is how I should invoke the program, LAME. I could definitely use shell_exec() http:

Use PowerShell to automate website login and file download

瘦欲@ 提交于 2020-01-05 05:39:11
问题 I want to use PowerShell to automate logging in to a website and downloading a PDF file. There are loads of examples on the internet that show how to do this (using Invoke-WebRequest , WebClient , HttpWebRequest , or InternetExplorer.Application ), but most don't require a login first. Some show it with login, but I can't get them to work. I'm close with using InternetExplorer.Application : $username = "xxxxx" $password = "yyyyy" $url = "https://example.com/login.aspx" $usernameElementId =

How Do I Bypass MS Access Startup When Using OLE?

隐身守侯 提交于 2020-01-05 05:20:08
问题 I am trying to do an automated xml export from an access database using C# and OLE. Everything is working perfectly except that the startup form is shown and won't close without user intervention. Here's what I am doing so far: objAccess = CreateObject("Access.Application"); objAccess.OpenCurrentDatabase("C:\\MYDB.mdb", true); //true = open in exclusive mode objAccess.ExportXML(0, "TestTable", "c:\\test.xml"); objAccess.CloseCurrentDatabase(); objAccess.Quit(); 回答1: As far as I know the only